InDesign Server2025
API 20.5.0.49
Collection of Layer

Layers

A collection of layers.

Properties

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

Methods

→ Layer

Returns the Layer with the specified index.

index Number The index.
→ Layer

Creates a new Layer.

withProperties? Object Initial values for properties of the new Layer
→ Layer

Returns any Layer in the collection.

→ Number

Displays the number of elements in the Layer.

→ Layer[]

Returns every Layer in the collection.

→ Layer

Returns the first Layer in the collection.

→ Layer

Returns the Layer with the specified index or name.

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

Returns the Layer with the specified ID.

id Number The ID.
→ Layer

Returns the Layer with the specified name.

name String The name.
→ Layer[]

Returns the Layers within the specified range.

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

Returns the last Layer in the collection.

→ Layer

Returns the middle Layer in the collection.

→ Layer

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

obj Layer The Layer whose index comes before the desired Layer.
→ Layer

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

obj Layer The index of the Layer that follows the desired Layer.
→ String

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

Object of 1

Properties elsewhere that hold a Layers.