MenuItem

A menu item.

Methods:

addEventListener, getElements, remove, removeEventListener, select, toSource, toSpecifier

Objects:

Boolean, EventListeners, Events, MenuAction, Number, Object, String,

Hierarchy:

Superclass: MenuElement

Class: MenuItem

Property Listing

Property

Type

Access

Description

associatedMenuAction

MenuAction

readonly

The menu action that implements the menu item.

checked

Boolean

readonly

If true, the menu item associated with the menu action is checked.

enabled

Boolean

readonly

If true, the MenuItem is enabled.

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

id

Number

readonly

The unique ID of the MenuItem.

index

Number

readonly

The index of the MenuItem within its containing object.

isValid

Boolean

readonly

Returns true if the object specifier resolves to valid objects.

name

String

readonly

The name of the MenuItem.

parent

Menu

Submenu

readonly

The parent of the MenuItem (a Menu or Submenu).

properties

Object

read/write

A property that allows setting of several properties at the same time.

title

String

readonly

The name of the MenuItem 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.

Method Listing

EventListener addEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Adds an event listener.

Parameter

Type

Description

eventType

String

The event type.

handler

File

JavaScriptFunction

The event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

MenuItem getElements ()

Resolves the object specifier, creating an array of object references.

undefined remove ()

Deletes the MenuItem.

Boolean removeEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Removes the event listener.

Parameter

Type

Description

eventType

String

The registered event type.

handler

File

JavaScriptFunction

The registered event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

undefined select ()

Selects the MenuItem.

String toSource ()

Generates a string which, if executed, will return the MenuItem.

String toSpecifier ()

Retrieves the object specifier.

Object of

Event.parent

EventListener.parent

MutationEvent.parent

Return

MenuItems.add()

MenuItem.getElements()

MenuItems.anyItem()

MenuItems.everyItem()

MenuItems.nextItem()

MenuItems.previousItem()

MenuItems.itemByID()

MenuItems.item()

MenuItems.[]()

MenuItems.itemByName()

MenuItems.itemByRange()

MenuItems.firstItem()

MenuItems.lastItem()

MenuItems.middleItem()