Class Menu : insertItem Method


void insertItem( String menuName, String commandName, [ String insertBeforeCommand ] )

Summary

Insert, or append, an item into the menu.


Remarks

If you wish to call a JavaScript function then you will need to call app.addNewCommand to register this command and function first.


Parameters

ParameterDescription
String menuName Text to appear on the menu
String commandName Command name for the menu.
String insertBeforeCommand [optional] The command name of the item you wish to insert before. If you don't provide this parameter then the menu is appended to the menu.


Examples

Insert an item

var menuMain = app.getMainMenu();
var menuTools = menuMain.getMenu( "&Tools" );

if( menuTools )
{
menuTools.insertItem( "Quick Test", "QuickTest", "SwitchCustomiseSettings" );
}


See Also

  • App : addNewCommand
  • Menu : insertMenu


    Requirements

    build 1065