Adobe InDesign CS2 (4.0) Object Model JS: Rectangles

InDesign CS2

Class

Rectangles

 A collection of rectangles.

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

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

ParameterTypeDescription
layerLayerThe layer on which to create the Rectangle. (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 Rectangle 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 Rectangle (Optional)

Rectangle anyItem ()
Returns any Rectangle in the collection.

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

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

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

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

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

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

ParameterTypeDescription
idnumberThe ID.

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

ParameterTypeDescription
namestringThe name.

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

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

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

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

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

ParameterTypeDescription
objRectangleThe Rectangle whose index comes before the desired Rectangle.

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

ParameterTypeDescription
objRectangleThe index of the Rectangle that follows the desired Rectangle.

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

Element of

Button.rectangles

Cell.rectangles

Character.rectangles

Document.rectangles

Footnote.rectangles

GraphicLine.rectangles

Group.rectangles

InsertionPoint.rectangles

Layer.rectangles

Line.rectangles

MasterSpread.rectangles

Oval.rectangles

Page.rectangles

PageItem.rectangles

Paragraph.rectangles

Polygon.rectangles

Rectangle.rectangles

Spread.rectangles

State.rectangles

Story.rectangles

Table.rectangles

Text.rectangles

TextColumn.rectangles

TextFrame.rectangles

TextStyleRange.rectangles

Word.rectangles

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