Adobe InCopy CS5.5 (7.5) Object Model JS: MenuAction

InCopy CS5.5

Class

MenuAction

 

A menu action.

Superclass of ScriptMenuAction

QuickLinks

addEventListener, extractLabel, getElements, insertLabel, invoke, removeEventListener, toSource, toSpecifier

Hierarchy

Application
MenuAction
ScriptMenuAction
Event | EventListener | MutationEvent

Properties

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

Class

PropertyTypeAccessDescription
AFTER_INVOKEstring readonlyDispatched after the MenuAction is invoked. This event does not bubble. This event is not cancelable. (default: afterInvoke)
BEFORE_INVOKEstring readonlyDispatched before the MenuAction is invoked. This event does not bubble. This event is cancelable. (default: beforeInvoke)

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)

string extractLabel (key: string)
Gets the label value associated with the specified key.

ParameterTypeDescription
keystringThe key.

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

void insertLabel (key: string, value: string)
Sets the label to the value associated with the specified key.

ParameterTypeDescription
keystringThe key.
valuestringThe value.

void invoke ()
Invoke the action.

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)

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

string toSpecifier ()
Retrieves the object specifier.

Element of

MenuItem.associatedMenuAction

Used in:

MenuAction MenuActions.nextItem (obj: MenuAction)

MenuAction MenuActions.previousItem (obj: MenuAction)

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

Return

Array of MenuAction MenuAction.getElements ()

MenuAction MenuActions.[] (index: number)

MenuAction MenuActions.anyItem ()

Array of MenuAction MenuActions.everyItem ()

MenuAction MenuActions.firstItem ()

MenuAction MenuActions.item (index: varies)

MenuAction MenuActions.itemByID (id: number)

MenuAction MenuActions.itemByName (name: string)

Array of MenuAction MenuActions.itemByRange (from: varies, to: varies)

MenuAction MenuActions.lastItem ()

MenuAction MenuActions.middleItem ()

MenuAction MenuActions.nextItem (obj: MenuAction)

MenuAction MenuActions.previousItem (obj: MenuAction)

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