InDesign Server2025
API 20.5.0.49
Collection of Document

Documents

A collection of documents.

Properties

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

Methods

Document

Returns the Document with the specified index.

index Number The index.
Document

Creates a new document

documentPreset? DocumentPreset The document preset to use.
withProperties? Object Initial values for properties of the new Document
Document

Returns any Document in the collection.

Number

Displays the number of elements in the Document.

Document[]

Returns every Document in the collection.

Document

Returns the first Document in the collection.

Document

Returns the Document with the specified index or name.

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

Returns the Document with the specified ID.

id Number The ID.
Document

Returns the Document with the specified name.

name String The name.
Document[]

Returns the Documents within the specified range.

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

Returns the last Document in the collection.

Document

Returns the middle Document in the collection.

Document

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

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

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

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

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

Object of 1

Properties elsewhere that hold a Documents.