I don't know the Scripting Documentation says you have to return something so that's the nicest way anyhoo.
And that way the string returned is very ugly.
So I made this: will write "/me is listening to %title% by %artist%"
code:
var string = new Array();
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)
{
if (sMessage.match(/^\^currentmedia(\s+|$)/i) != null)
{
string = Messenger.MyCurrentMedia.split("\\");
switch (string[0])
{
case "ITunes":
return "/me is now playing " + string[4].substr(1) + " by " + string[5].substr(1);
break;
case "":
return "/me is now playing " + string[4].substr(1) + " by " + string[5].substr(1);
break;
default:
return "/me is now playing " + Messenger.MyCurrentMedia;
}
}
else
{
return sMessage;
}
}