Adobe InDesign CS2 (4.0) Object Model JS: Buttons

InDesign CS2

Class

Buttons

 A collection of buttons.

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

Button add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: any][, withProperties: Object])
Create a new Button

ParameterTypeDescription
layerLayerThe layer on which to create the Button. (Optional)
atLocationOptions:
LocationOptions.BEFORE
LocationOptions.AFTER
LocationOptions.AT_END
LocationOptions.AT_BEGINNING
LocationOptions.UNKNOWN
Location (Optional) (default: LocationOptions.UNKNOWN)
referenceDocument
Layer
MasterSpread
Page
Spread
Before/after this Button or at the beginning/end of this Document, Spread, Master Spread, Page or Layer. Can accept: Document, Spread, MasterSpread, Page or Layer. (Optional)
withPropertiesObjectInitial values for properties of the new Button (Optional)

Button anyItem ()
Returns any Button in the collection.

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

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

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

Button item (index: any)
Returns the Button with the specified index or name.

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

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

ParameterTypeDescription
idnumberThe ID.

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

ParameterTypeDescription
namestringThe name.

Array of Button itemByRange (from: any, to: any)
Returns the Buttons within the specified range.

ParameterTypeDescription
fromButton
Long
String
The Button, index, or name at the beginning of the range. Can accept: Button, Long or String.
toButton
Long
String
The Button, index, or name at the end of the range. Can accept: Button, Long or String.

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

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

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

ParameterTypeDescription
objButtonThe Button whose index comes before the desired Button.

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

ParameterTypeDescription
objButtonThe index of the Button that follows the desired Button.

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

Element of

Cell.buttons

Character.buttons

Document.buttons

Group.buttons

InsertionPoint.buttons

Layer.buttons

Line.buttons

MasterSpread.buttons

Page.buttons

Paragraph.buttons

Spread.buttons

Story.buttons

Table.buttons

Text.buttons

TextColumn.buttons

TextFrame.buttons

TextStyleRange.buttons

Word.buttons

Jongware, 27-Jun-2010 v3.0.3dContents :: Index