InDesign2026
API 21.5.1.73
Collection of Swatch

Swatches

A collection of swatches.

Properties

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

Methods

Swatch

Returns the Swatch with the specified index.

index Number The index.
Swatch

Returns any Swatch in the collection.

Number

Displays the number of elements in the Swatch.

Swatch[]

Returns every Swatch in the collection.

Swatch

Returns the first Swatch in the collection.

Swatch

Returns the Swatch with the specified index or name.

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

Returns the Swatch with the specified ID.

id Number The ID.
Swatch

Returns the Swatch with the specified name.

name String The name.
Swatch[]

Returns the Swatches within the specified range.

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

Returns the last Swatch in the collection.

Swatch

Returns the middle Swatch in the collection.

Swatch

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

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

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

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

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

Object of 2

Properties elsewhere that hold a Swatches.

Parameter of 6

Method parameters that accept a Swatches.