addCommand
Adds a new script command to the Tool menu.
Syntax
anApplication addCommand (name, caption, shortcut, function, language)
Parameters
name - String
The name of the command.
caption - String
The caption of the command to display in the menu.
shortcut - String
An optional shortcut (leave empty for no shortcut).
function - String
A reference to the function to execute.
language - String
The command will apply only to this language. Empty to use the command with any languages.
Remarks
Commands can be added only from the initialize functions of scripts.
The name is used to override the default shortcut in a key-mapping. For example add a line like this in the user-options:
key-mappings.windows-style.example-command = SHIFT+F9
Example:
function initialize (settings) settings addCommand ("close-xml-element", "Close XML Element", "", ref closeXMLTag, "xml") settings addCommand ("format-xml", "Format XML document", "", ref formatXML, "xml") end