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
Parameter |
Type |
Description |
---|---|---|
|
DocumentColorSpace, optional |
Color space of document |
|
Number (double), optional |
Width of document to add |
|
Number (double), optional |
Height of document to add |
|
Number (long), optional |
Number of artboards to create |
|
DocumentArtboardLayout, optional |
Artboard layout |
|
Number, optional |
Number of pixels for spacing |
|
Integer, optional |
Number of rows or columns |
Returns
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 |
---|---|---|
|
String |
Startup preset to use |
|
DocumentPreset, optional |
Preset document template |
|
Boolean, optional |
Whether to show options dialog |
Returns
Documents.addDocumentNoUI()¶
app.documents.addDocumentNoUI(startupPreset)
Description
Creates a document without showing in UI.
Parameters
Parameter |
Type |
Description |
---|---|---|
|
String |
Startup preset to use |
Returns
Documents.getByName()¶
app.documents.getByName(name)
Description
Gets the first element in the collection with the specified name.
Parameters
Parameter |
Type |
Description |
---|---|---|
|
String |
Name of element to get |
Returns
Documents.index()¶
app.documents.index(itemKey)
Description
Gets an element from the collection.
Parameters
Parameter |
Type |
Description |
---|---|---|
|
String, Number |
String or number key |
Returns
Example¶
Creating a new document¶
// Creates a new document with an RGB color space
app.documents.add(DocumentColorSpace.RGB);