Adobe InCopy CS5 (7.0) Object Model JS: ScriptMenuAction

InCopy CS5

Class

ScriptMenuAction

 A script menu action. Base Class: MenuAction

QuickLinks

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

Hierarchy

Application
MenuAction
ScriptMenuAction
Event | EventListener | MutationEvent

Properties

PropertyTypeAccessDescription
areastring r/wThe menu action area.
checkedbool r/wIf true, the menu item associated with the menu action is checked.
enabledbool r/wIf true, the ScriptMenuAction is enabled.
eventListenersEventListeners readonlyA collection of event listeners.
eventsEvents readonlyA collection of events.
idnumber readonlyThe unique ID of the ScriptMenuAction.
indexnumber readonlyThe index of the ScriptMenuAction 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 r/wThe name of the ScriptMenuAction.
parentApplication readonlyThe parent of the ScriptMenuAction (a Application).
propertiesObject r/wA property that allows setting of several properties at the same time.
titlestring r/wThe name of the ScriptMenuAction 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 ScriptMenuAction is invoked. This event does not bubble. This event is not cancelable. (default: afterInvoke)
BEFORE_DISPLAYstring readonlyDispatched before the ScriptMenuAction is displayed. This event does not bubble. This event is not cancelable. (default: beforeDisplay)
BEFORE_INVOKEstring readonlyDispatched before the ScriptMenuAction is invoked. This event does not bubble. This event is cancelable. (default: beforeInvoke)
ON_INVOKEstring readonlyDispatched when the ScriptMenuAction is invoked. This event does not bubble. This event is not cancelable. (default: onInvoke)

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 ScriptMenuAction 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.

void remove ()
Deletes the ScriptMenuAction.

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 ScriptMenuAction.

string toSpecifier ()
Retrieves the object specifier.

Used in:

ScriptMenuAction ScriptMenuActions.nextItem (obj: ScriptMenuAction)

ScriptMenuAction ScriptMenuActions.previousItem (obj: ScriptMenuAction)

Return

Array of ScriptMenuAction ScriptMenuAction.getElements ()

ScriptMenuAction ScriptMenuActions.[] (index: number)

ScriptMenuAction ScriptMenuActions.add ([title: string][, withProperties: Object])

ScriptMenuAction ScriptMenuActions.anyItem ()

Array of ScriptMenuAction ScriptMenuActions.everyItem ()

ScriptMenuAction ScriptMenuActions.firstItem ()

ScriptMenuAction ScriptMenuActions.item (index: varies)

ScriptMenuAction ScriptMenuActions.itemByID (id: number)

ScriptMenuAction ScriptMenuActions.itemByName (name: string)

Array of ScriptMenuAction ScriptMenuActions.itemByRange (from: varies, to: varies)

ScriptMenuAction ScriptMenuActions.lastItem ()

ScriptMenuAction ScriptMenuActions.middleItem ()

ScriptMenuAction ScriptMenuActions.nextItem (obj: ScriptMenuAction)

ScriptMenuAction ScriptMenuActions.previousItem (obj: ScriptMenuAction)

Jongware, 23-Mar-2011 v3.0.3dContents :: Index