Adobe InCopy CS6 (8.0) Object Model JS: MenuItem

InCopy CS6

Class

MenuItem

 A menu item. Base Class: MenuElement

QuickLinks

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

Hierarchy

Menu | Submenu
MenuElement
MenuItem
Event | EventListener | MutationEvent

Properties

PropertyTypeAccessDescription
associatedMenuActionMenuAction readonlyThe menu action that implements the menu item.
checkedbool readonlyIf true, the menu item associated with the menu action is checked.
enabledbool readonlyIf true, the MenuItem is enabled.
eventListenersEventListeners EventListener readonlyA collection of event listeners.
eventsEvents Event readonlyA collection of events.
idnumber readonlyThe unique ID of the MenuItem.
indexnumber readonlyThe index of the MenuItem within its containing object.
isValidbool readonlyReturns true if the object specifier resolves to valid objects.
namestring readonlyThe name of the MenuItem.
parentMenuSubmenu readonlyThe parent of the MenuItem (a Menu or Submenu).
propertiesObject r/wA property that allows setting of several properties at the same time.
titlestring readonlyThe 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.

Methods

Instances

EventListener addEventListener (eventType: string, handler: varies[, captures: bool=false])
Adds an event listener.

ParameterTypeDescription
eventTypestringThe event type.
handlerFile
JavaScript Function
The event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

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

void remove ()
Deletes the MenuItem.

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

ParameterTypeDescription
eventTypestringThe registered event type.
handlerFile
JavaScript Function
The registered event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

void select ()
Selects the MenuItem.

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

string toSpecifier ()
Retrieves the object specifier.

Used in:

MenuItem MenuItems.nextItem (obj: MenuItem)

MenuItem MenuItems.previousItem (obj: MenuItem)

Return

Array of MenuItem MenuItem.getElements ()

MenuItem MenuItems.[] (index: number)

MenuItem MenuItems.add (associatedMenuAction: MenuAction[, at: LocationOptions=LocationOptions.AT_END][, reference: MenuElement][, withProperties: Object])

MenuItem MenuItems.anyItem ()

Array of MenuItem MenuItems.everyItem ()

MenuItem MenuItems.firstItem ()

MenuItem MenuItems.item (index: varies)

MenuItem MenuItems.itemByID (id: number)

MenuItem MenuItems.itemByName (name: string)

Array of MenuItem MenuItems.itemByRange (from: varies, to: varies)

MenuItem MenuItems.lastItem ()

MenuItem MenuItems.middleItem ()

MenuItem MenuItems.nextItem (obj: MenuItem)

MenuItem MenuItems.previousItem (obj: MenuItem)

Jongware, 29-Apr-2012 v3.0.3iContents :: Index