Skip to content

Documents

app.documents

A collection of Document objects.


app.documents.length

The number of objects in the collection.

Number; read-only.


app.documents.parent

The parent of this object.

Object; read-only.


app.documents.typename

The class name of the referenced object.

String; read-only.


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

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

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

Document


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

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

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

Document


app.documents.addDocumentNoUI(startupPreset)

Creates a document without showing in UI.

ParameterTypeDescription
startupPresetStringStartup preset to use

Document


app.documents.getByName(name)

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

ParameterTypeDescription
nameStringName of element to get

Document


app.documents.index(itemKey)

Gets an element from the collection.

ParameterTypeDescription
itemKeyString, NumberString or number key

Document


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