Menu

A menu.

Properties

Property Type Access Description
eventListeners EventListeners readonly A collection of event listeners.
events Events readonly A collection of events.
index number readonly The index of the Menu within its containing object.
menuElements MenuElements readonly A collection of menu elements.
menuItems MenuItems readonly A collection of menu items.
menuSeparators MenuSeparators readonly A collection of menu separators.
name string readonly The name of the Menu.
parent Application readonly The parent of the Menu (a Application).
properties Object r/w A property that allows setting of several properties at the same time.
submenus Submenus readonly A collection of submenus.
title string readonly The name of the Menu for display in the user interface. The title includes any ampersand characters (&), which are used to tell the Windows OS to underline the following character in the name for use with the Alt key to navigate to a menu item. Double ampersands are used to display an actual ampersand character in the name. The Mac OS ignores and removes the extra ampersand characters.

Methods

EventListeneraddEventListener (eventType:
string, handler:
any[, captures:
bool=false ])
Adds an event listener.

Parameter Type Description
eventType string The event type.
handler File
JavaScript Function
The event handler. Can accept: File or JavaScript Function.
captures bool If true, the handler is called only in the capturing phase of event propagation. If false, the handler is called in the bubbling phase if this Menu is an ancestor of the target, or in the at-target phase if this Menu is itself the target of the event. (Optional) (default: false )

Array of MenugetElements ()
Resolves the object specifier, creating an array of object references.

bool removeEventListener (eventType:
string, handler:
any[, captures:
bool=false ])
Removes the event listener.

Parameter Type Description
eventType string The registered event type.
handler File
JavaScript Function
The registered event handler. Can accept: File or JavaScript Function.
captures bool If true, the handler was to respond only in the capture phase. (Optional) (default: false )

string toSource ()
Generates a string which, if executed, will return the Menu.

string toSpecifier ()
Retrieves the object specifier.

Used in:

Menus.previousItem (

obj:
Menu )

Menus.nextItem (

obj:
Menu )

Returned by:

Array of Menu Menu .getElements (

)

Menu Menus.anyItem (

)

Array of Menu Menus.everyItem (

)

Menu Menus.firstItem (

)

Menu Menus.item (
index:
any
)

Menu Menus.itemByName (
name:
string
)

Array of Menu Menus.itemByRange (
from:
any, to:
any
)

Menu Menus.lastItem (

)

Menu Menus.middleItem (

)

Menu Menus.nextItem (
obj:
Menu
)

Menu Menus.previousItem (
obj:
Menu
)

Leave a Comment

Previous post:

Next post: