InDesign2026
API 21.5.1.73
Collection of MenuItem

MenuItems

A collection of menu items.

Properties

NameType AccessDescription
Number readonly The number of objects in the collection.

Methods

MenuItem

Returns the MenuItem with the specified index.

index Number The index.
MenuItem

Creates a new menu item.

associatedMenuAction MenuAction The menu action that implements the menu item.
at? LocationOptions The location of the menu item relative to the reference object or within the containing object.
reference? MenuElement The reference object. Note: Required when the at parameter specifies before or after.
withProperties? Object Initial values for properties of the new MenuItem
MenuItem

Returns any MenuItem in the collection.

Number

Displays the number of elements in the MenuItem.

MenuItem[]

Returns every MenuItem in the collection.

MenuItem

Returns the first MenuItem in the collection.

MenuItem

Returns the MenuItem with the specified index or name.

index LongInteger | String The index or name. Can accept: Long Integer or String.
MenuItem

Returns the MenuItem with the specified ID.

id Number The ID.
MenuItem

Returns the MenuItem with the specified name.

name String The name.
MenuItem[]

Returns the MenuItems within the specified range.

from LongInteger | MenuItem | String The MenuItem, index, or name at the beginning of the range. Can accept: MenuItem, Long Integer or String.
to LongInteger | MenuItem | String The MenuItem, index, or name at the end of the range. Can accept: MenuItem, Long Integer or String.
MenuItem

Returns the last MenuItem in the collection.

MenuItem

Returns the middle MenuItem in the collection.

MenuItem

Returns the MenuItem whose index follows the specified MenuItem in the collection.

obj MenuItem The MenuItem whose index comes before the desired MenuItem.
MenuItem

Returns the MenuItem with the index previous to the specified index.

obj MenuItem The index of the MenuItem that follows the desired MenuItem.
String

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

Object of 2

Properties elsewhere that hold a MenuItems.