I would have linked to the scripting documentation page, but the site seems to be down for maintenance.
quote:
Source: Scripting Documentation > Events Reference > Messenger Plus! Events > OnGetScriptMenu
The OnGetScriptMenu event is fired when some of the Messenger Plus! menus are displayed. It allows scripts to return their own menu to be added to Messenger Plus!'s one.
Syntax
Javascript code:
[string] OnGetScriptMenu(
[enum] Location
);
Parameters
Location
[enum] A number specifying the location of the menu that triggered the event. You can use this parameter to display a different menu depending on what the current user is currently doing. It can be one of the following values:
code:
MENULOC_CONTACTLIST (1) Contact List
MENULOC_CHATWND (2) Messenger Chat Window
MENULOC_MOBILEWND (3) Mobile Device Chat Window
Return Value
An XML data string defining the script's menu. If no menu is required, return an empty string. For more information about the way to define the menu's data, see the ScriptInfo's schema documentation.
Remarks
The script's menu can be defined statically in the ScriptInfo.xml file or returned by this function is its content needs changes at runtime. If a menu is returned by this handler, it gets priority over the menu defined in ScriptInfo.xml.
If an item of the script's menu is selected by the current user, an OnEvent_MenuClicked is fired.
Messenger Plus! 4.23 and earlier: enumeration names are not available, numbers must be used instead.
Messenger Plus! 4.50 and earlier: MENULOC_MOBILEWND is not supported.
Example
Event handler generating a simple menu for the script:
Javascript code:
function OnGetScriptMenu(Location)
{
var ScriptMenu = "<ScriptMenu>";
ScriptMenu += "<MenuEntry Id=\"MnuFeat1\">Feature 1</MenuEntry>";
ScriptMenu += "<MenuEntry Id=\"MnuFeat2\">Feature 2</MenuEntry>";
ScriptMenu += "<Separator/>";
ScriptMenu += "<MenuEntry Id=\"MnuAbout\">About...</MenuEntry>";
ScriptMenu += "</ScriptMenu>";
return ScriptMenu;
}