What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] Disable/Enable.

[Request] Disable/Enable.
Author: Message:
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
RE: [Request] Disable/Enable.
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.  :)
04-09-2010 08:15 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Request] Disable/Enable. - by Seed on 04-09-2010 at 07:54 PM
RE: [Request] Disable/Enable. - by whiz on 04-09-2010 at 08:15 PM
RE: [Request] Disable/Enable. - by matty on 04-09-2010 at 08:15 PM
RE: [Request] Disable/Enable. - by Seed on 04-09-2010 at 08:51 PM
RE: [Request] Disable/Enable. - by matty on 04-09-2010 at 09:45 PM
RE: [Request] Disable/Enable. - by Spunky on 04-09-2010 at 11:03 PM
RE: RE: [Request] Disable/Enable. - by Volv on 04-09-2010 at 11:18 PM
RE: [Request] Disable/Enable. - by Seed on 04-10-2010 at 10:54 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On