Instead of defining the ScriptMenu in the ScriptInfo.xml, do it within the script itself. So now, you can display the Show Recent Tracks option only in ChatWnds
.
code:
function OnGetScriptMenu(Location){
var ScriptMenu = "<ScriptMenu>";
if(Location == 2)// If accessed from ChatWnd
ScriptMenu += " <MenuEntry Id=\"SendRecentTracks\">Send recent tracks</MenuEntry>";
ScriptMenu += " <MenuEntry Id=\"Options\">Options</MenuEntry>";
ScriptMenu += " <Separator/>";
ScriptMenu += " <MenuEntry Id=\"About\">About</MenuEntry>";
ScriptMenu += "</ScriptMenu>";
return ScriptMenu;
}