A script menu action.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
| area | string | r/w | The menu action area. |
| checked | bool | r/w | If true, the menu item associated with the menu action is checked. |
| enabled | bool | r/w | If true, the menu action is enabled. |
| eventListeners | EventListeners | readonly | A collection of event listeners. |
| events | Events | readonly | A collection of events. |
| id | number | readonly | The unique ID of the ScriptMenuAction. |
| index | number | readonly | The index of the ScriptMenuAction within its containing object. |
| label | string | r/w | A property that can be set to any string. |
| name | string | r/w | The name of the ScriptMenuAction. |
| parent | Application | readonly | The parent of the ScriptMenuAction (a Application). |
| properties | Object | r/w | A property that allows setting of several properties at the same time. |
| title | string | r/w | The 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. |
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 ScriptMenuAction is an ancestor of the target, or in the at-target phase if this ScriptMenuAction is itself the target of the event. (Optional) (default: false ) |
string extractLabel (key:
string)
Gets the label value associated with the specified key.
| Parameter | Type | Description |
|---|---|---|
| key | string | The key. |
Array of ScriptMenuActiongetElements ()
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.
| Parameter | Type | Description |
|---|---|---|
| key | string | The key. |
| value | string | The value. |
void invoke ()
Invoke the action.
void remove ()
Deletes the ScriptMenuAction.
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 ScriptMenuAction.
string toSpecifier ()
Retrieves the object specifier.
Used in:
ScriptMenuActions.previousItem (
obj:
ScriptMenuAction )
ScriptMenuActions.nextItem (
obj:
ScriptMenuAction )
Returned by:
Array of ScriptMenuAction ScriptMenuAction .getElements (
)
ScriptMenuAction ScriptMenuActions.add (
[title:
string][, withProperties:
Object]
)
ScriptMenuAction ScriptMenuActions.anyItem (
)
Array of ScriptMenuAction ScriptMenuActions.everyItem (
)
ScriptMenuAction ScriptMenuActions.firstItem (
)
ScriptMenuAction ScriptMenuActions.item (
index:
any
)
ScriptMenuAction ScriptMenuActions.itemByID (
id:
number
)
ScriptMenuAction ScriptMenuActions.itemByName (
name:
string
)
Array of ScriptMenuAction ScriptMenuActions.itemByRange (
from:
any, to:
any
)
ScriptMenuAction ScriptMenuActions.lastItem (
)
ScriptMenuAction ScriptMenuActions.middleItem (
)
ScriptMenuAction ScriptMenuActions.nextItem (
obj:
ScriptMenuAction
)
ScriptMenuAction ScriptMenuActions.previousItem (
obj:
ScriptMenuAction
)