Hi,
I'm trying to create a winamp msn control, with the
ActiveWinamp plugin voor winamp.
The plugin creates a COM object named ActiveWinamp.Application So i'm trying this:
code:
var winamp;
var playlist;
var shell;
function OnEvent_Initialize(MessengerStart)
{
try
{
winamp = new ActiveXObject('ActiveWinamp.Application');
}
catch (e)
{
Debug.Trace("Could not create winamp Object");
MsgPlus.DisplayToast("MSN Winamp", "Could not create winamp object. Have you installed ActiveWinamp?\n\nClick here to install Active Winamp", "", "OnWinampErrorToastClick");
}
shell = new ActiveXObject('WScript.Shell');
var x;
for(x in winamp)
{
Debug.Trace(x);
}
// So far, so good. Ik get no errors
// But in my script debugger, I also get 0 properties
// (See for loop above)
}
function OnEvent_Uninitialize(MessengerExit)
{
}
function OnWinampErrorToastClick(param)
{
shell.Run("http://www.myplugins.info/activewinamp");
}
function OnGetScriptMenu()
{
return "<ScriptMenu><MenuEntry Id='MenuCurrentSong'>Send Current Song</MenuEntry></ScriptMenu>";
}
function OnEvent_MenuClicked(id, Location, wnd)
{
if(id == "MenuCurrentSong")
{
wnd.SendMessage(winamp.playlist[winamp.playlist.position].ATFSTring("[%artist% - ]$if2(%title%,$filepart(%filename%))"));
// At the line above, I get an error. winamp.playlist[...] is null or something
}
}
I get no error when the object is created, but the object has no properties...
Does anybody know what the problem can be?