简体   繁体   中英

Winamp with gen_scripting in Jscript

Using the gen_scripting plugin for Winamp you must instantiate the object. In VBS this is

Set winamp = CreateObject("gen_scripting.WinAmp")

However, I'm pretty sure that the same plug-in can be used to script Winamp using Jscript (or possibly even Javascript - a better choice for me). So, I've tried

var winamp = Object.create("gen_scripting.WinAmp");
x = winamp.GetVersion();
alert(x);
winamp.ButtonPlay;

Only that doesn't work. Any help to get me started would be appreciated

JScript analog of VBScript CreateObject() is new ActiveXObject() .

Also, alert is a browser-specific function; in Windows shell scripts you should use WScript.Echo .

var winamp = new ActiveXObject("gen_scripting.WinAmp");
var x = winamp.GetVersion();
WScript.Echo(x);
winamp.ButtonPlay();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM