Adobe InDesign CS6 (8.0) Object Model JS: MenuItems

InDesign CS6

Class

MenuItems

 A collection of menu items.

QuickLinks

[], add, anyItem, count, everyItem, firstItem, item, itemByID, itemByName, itemByRange, lastItem, middleItem, nextItem, previousItem, toSource

Properties

PropertyTypeAccessDescription
lengthnumber readonlyThe number of objects in the collection.

Methods

Instances

MenuItem [] (index: number)
Returns the MenuItem with the specified index.

ParameterTypeDescription
indexnumberThe index.

MenuItem add (associatedMenuAction: MenuAction[, at: LocationOptions=LocationOptions.AT_END][, reference: MenuElement][, withProperties: Object])
Creates a new menu item.

ParameterTypeDescription
associatedMenuActionMenuActionThe menu action that implements the menu item.
atLocationOptions:
LocationOptions.BEFORE
LocationOptions.AFTER
LocationOptions.AT_END
LocationOptions.AT_BEGINNING
LocationOptions.UNKNOWN
The location of the menu item relative to the reference object or within the containing object. (Optional) (default: LocationOptions.AT_END)
referenceMenuElementThe reference object. Note: Required when the at parameter specifies before or after. (Optional)
withPropertiesObjectInitial values for properties of the new MenuItem (Optional)

MenuItem anyItem ()
Returns any MenuItem in the collection.

number count ()
Displays the number of elements in the MenuItem.

Array of MenuItem everyItem ()
Returns every MenuItem in the collection.

MenuItem firstItem ()
Returns the first MenuItem in the collection.

MenuItem item (index: varies)
Returns the MenuItem with the specified index or name.

ParameterTypeDescription
indexLong Integer
String
The index or name. Can accept: Long Integer or String.

MenuItem itemByID (id: number)
Returns the MenuItem with the specified ID.

ParameterTypeDescription
idnumberThe ID.

MenuItem itemByName (name: string)
Returns the MenuItem with the specified name.

ParameterTypeDescription
namestringThe name.

Array of MenuItem itemByRange (from: varies, to: varies)
Returns the MenuItems within the specified range.

ParameterTypeDescription
fromLong Integer
MenuItem
String
The MenuItem, index, or name at the beginning of the range. Can accept: MenuItem, Long Integer or String.
toLong Integer
MenuItem
String
The MenuItem, index, or name at the end of the range. Can accept: MenuItem, Long Integer or String.

MenuItem lastItem ()
Returns the last MenuItem in the collection.

MenuItem middleItem ()
Returns the middle MenuItem in the collection.

MenuItem nextItem (obj: MenuItem)
Returns the MenuItem whose index follows the specified MenuItem in the collection.

ParameterTypeDescription
objMenuItemThe MenuItem whose index comes before the desired MenuItem.

MenuItem previousItem (obj: MenuItem)
Returns the MenuItem with the index previous to the specified index.

ParameterTypeDescription
objMenuItemThe index of the MenuItem that follows the desired MenuItem.

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

Element of

Menu.menuItems

Submenu.menuItems

Jongware, 28-Apr-2012 v3.0.3hContents :: Index