MenuItems

A collection of menu items.

Methods:

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

Property Listing

Property

Type

Access

Description

length

Number

readonly

The number of objects in the collection.

Method Listing

MenuItem [] (index:Number)

Returns the MenuItem with the specified index.

Parameter

Type

Description

index

Number

The index.

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

Creates a new menu item.

Parameter

Type

Description

associatedMenuAction

MenuAction

The menu action that implements the menu item.

at

LocationOptions

LocationOptions.AFTER

LocationOptions.AT_BEGINNING

LocationOptions.AT_END

LocationOptions.BEFORE

LocationOptions.UNKNOWN

The location of the menu item relative to the reference object or within the containing object. (Optional)

(default: LocationOptions.AT_END)

reference

MenuElement

The reference object. Note: Required when the at parameter specifies before or after. (Optional)

withProperties

Object

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

MenuItem everyItem ()

Returns every MenuItem in the collection.

MenuItem firstItem ()

Returns the first MenuItem in the collection.

MenuItem item (index:Varies LongInteger String)

Returns the MenuItem with the specified index or name.

Parameter

Type

Description

index

LongInteger

String

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

MenuItem itemByID (id:Number)

Returns the MenuItem with the specified ID.

Parameter

Type

Description

id

Number

The ID.

MenuItem itemByName (name:String)

Returns the MenuItem with the specified name.

Parameter

Type

Description

name

String

The name.

MenuItem itemByRange (from:Varies LongInteger MenuItem String, to:Varies LongInteger MenuItem String)

Returns the MenuItems within the specified range.

Parameter

Type

Description

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

Parameter

Type

Description

obj

MenuItem

The MenuItem whose index comes before the desired MenuItem.

MenuItem previousItem (obj:MenuItem)

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

Parameter

Type

Description

obj

MenuItem

The index of the MenuItem that follows the desired MenuItem.

String toSource ()

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

Object of

Menu.menuItems

Submenu.menuItems