문제

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();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top