getMenuItemByName()

Description:

Call the getMenuItemByName method with a specified menu item's label to retrieve the handle of the menu item instance.

For more general information on creating an options menu, see Using softkeys.

Syntax:

[MenuItem] window.menu.getMenuItemByName(String menuItemLabel) 

or

[MenuItem] menu.getMenuItemByName(String menuItemLabel)

Arguments:

  • menuItemLabel:

    This is the label of an existing menu item whose handle is being retrieved.

Return value:

The returned value is an instance of the existing MenuItem object. If the label is invalid, the method returns "undefined".

Example code:

See the example code in the description of the MenuItem.onSelect property.