Skip to content

Latest commit

 

History

History
229 lines (142 loc) · 6.83 KB

Documents.rst

File metadata and controls

229 lines (142 loc) · 6.83 KB

Documents

app.documents

Description

A collection of jsobjref/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

Parameter Type Description
documentColorSpace jsobjref/scripting-constants.DocumentColorSpace, optional Color space of document
width Number (double), optional Width of document to add
height Number (double), optional Height of document to add
numArtBoards Number (long), optional Number of artboards to create
artboardLayout jsobjref/scripting-constants.DocumentArtboardLayout, optional Artboard layout
artboardSpacing Number, optional Number of pixels for spacing
artboardRowsOrCols Integer, optional Number of rows or columns

Returns

jsobjref/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

Parameter Type Description
startupPreset String Startup preset to use
presetSettings jsobjref/DocumentPreset, optional Preset document template
showOptionsDialog Boolean, optional Whether to show options dialog

Returns

jsobjref/Document


Documents.addDocumentNoUI()

app.documents.addDocumentNoUI(startupPreset)

Description

Creates a document without showing in UI.

Parameters

Parameter Type Description
startupPreset String Startup preset to use

Returns

jsobjref/Document


Documents.getByName()

app.documents.getByName(name)

Description

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

Parameters

Parameter Type Description
name String Name of element to get

Returns

jsobjref/Document


Documents.index()

app.documents.index(itemKey)

Description

Gets an element from the collection.

Parameters

Parameter Type Description
itemKey String, Number String or number key

Returns

jsobjref/Document


Example

Creating a new document

// Creates a new document with an RGB color space

app.documents.add(DocumentColorSpace.RGB);