js code:
var Enabled = 1;
function OnGetScriptMenu()
{
var Menu = "<ScriptMenu>";
Menu += " <MenuEntry Id=\"ToggleEnable\">" + (Enabled ? "En" : "Dis") + "able...</MenuEntry>";
return Menu + "</ScriptMenu>";
}
function OnEvent_MenuClicked(MenuItemId, Location, OriginWnd)
{
switch (MenuItemId)
{
case "ToggleEnable":
Enabled = !Enabled; // toggle the value
break;
// add additional menu items here...
}
}
That'll make a menu, which, when enabled, will display "Disable...", and when disabled, will display "Enable...".
Also... using "goto" is for batch files, not JScript.