Skip to content

Documents

Documents

app.documents

Description

A collection of Document objects.


Properties

Documents.length

app.documents.length

Description

The number of objects in the collection.

Type

Number; read-only.


Documents.parent

app.documents.parent

Description

The parent of this object.

Type

Object; read-only.


Documents.typename

app.documents.typename

Description

The class name of the referenced object.

Type

String; read-only.


Methods

Documents.add()

app.documents.add(
[documentColorSpace]
[, width]
[, height]
[, numArtBoards]
[, artboardLayout]
[, artboardSpacing]
[, artboardRowsOrCols]
)

Description

Creates a new document using optional parameters and returns a reference to the new document.

Parameters

ParameterTypeDescription
documentColorSpaceDocumentColorSpace, optionalColor space of document
widthNumber (double), optionalWidth of document to add
heightNumber (double), optionalHeight of document to add
numArtBoardsNumber (long), optionalNumber of artboards to create
artboardLayoutDocumentArtboardLayout, optionalArtboard layout
artboardSpacingNumber, optionalNumber of pixels for spacing
artboardRowsOrColsInteger, optionalNumber of rows or columns

Returns

Document


Documents.addDocument()

app.documents.addDocument(startupPreset[, presetSettings][, showOptionsDialog])

Description

Creates a document from the preset, replacing any provided setting values, and returns a reference to the new document.

Parameters

ParameterTypeDescription
startupPresetStringStartup preset to use
presetSettingsDocumentPreset, optionalPreset document template
showOptionsDialogBoolean, optionalWhether to show options dialog

Returns

Document


Documents.addDocumentNoUI()

app.documents.addDocumentNoUI(startupPreset)

Description

Creates a document without showing in UI.

Parameters

ParameterTypeDescription
startupPresetStringStartup preset to use

Returns

Document


Documents.getByName()

app.documents.getByName(name)

Description

Gets the first element in the collection with the specified name.

Parameters

ParameterTypeDescription
nameStringName of element to get

Returns

Document


Documents.index()

app.documents.index(itemKey)

Description

Gets an element from the collection.

Parameters

ParameterTypeDescription
itemKeyString, NumberString or number key

Returns

Document


Example

Creating a new document

// Creates a new document with an RGB color space
app.documents.add(DocumentColorSpace.RGB);