InDesign2026
API 21.5.1.73
Collection of Rectangle

Rectangles

A collection of rectangles.

Properties

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

Methods

Rectangle

Returns the Rectangle with the specified index.

index Number The index.
Rectangle

Creates a new Rectangle

layer? Layer The layer on which to create the Rectangle.
at? LocationOptions The location at which to insert the Rectangle relative to the reference object or within the container object.
reference? Document | Layer | MasterSpread | Page | Spread | PageItem The reference object. Note: Required when the at parameter is before or after. Can accept: Document, Spread, MasterSpread, Page, Layer or PageItem.
withProperties? Object Initial values for properties of the new Rectangle
Rectangle

Returns any Rectangle in the collection.

Number

Displays the number of elements in the Rectangle.

Rectangle[]

Returns every Rectangle in the collection.

Rectangle

Returns the first Rectangle in the collection.

Rectangle

Returns the Rectangle with the specified index or name.

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

Returns the Rectangle with the specified ID.

id Number The ID.
Rectangle

Returns the Rectangle with the specified name.

name String The name.
Rectangle[]

Returns the Rectangles within the specified range.

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

Returns the last Rectangle in the collection.

Rectangle

Returns the middle Rectangle in the collection.

Rectangle

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

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

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

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

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

Object of 38

Properties elsewhere that hold a Rectangles.