Documents
Documents
Section titled “Documents”app.documents
Description
Section titled “Description”A collection of Document objects.
Properties
Section titled “Properties”Documents.length
Section titled “Documents.length”app.documents.length
Description
Section titled “Description”The number of objects in the collection.
Number; read-only.
Documents.parent
Section titled “Documents.parent”app.documents.parent
Description
Section titled “Description”The parent of this object.
Object; read-only.
Documents.typename
Section titled “Documents.typename”app.documents.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Methods
Section titled “Methods”Documents.add()
Section titled “Documents.add()”app.documents.add( [documentColorSpace] [, width] [, height] [, numArtBoards] [, artboardLayout] [, artboardSpacing] [, artboardRowsOrCols])
Description
Section titled “Description”Creates a new document using optional parameters and returns a reference to the new document.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
documentColorSpace | 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 | DocumentArtboardLayout, optional | Artboard layout |
artboardSpacing | Number, optional | Number of pixels for spacing |
artboardRowsOrCols | Integer, optional | Number of rows or columns |
Returns
Section titled “Returns”Documents.addDocument()
Section titled “Documents.addDocument()”app.documents.addDocument(startupPreset[, presetSettings][, showOptionsDialog])
Description
Section titled “Description”Creates a document from the preset, replacing any provided setting values, and returns a reference to the new document.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
startupPreset | String | Startup preset to use |
presetSettings | DocumentPreset, optional | Preset document template |
showOptionsDialog | Boolean, optional | Whether to show options dialog |
Returns
Section titled “Returns”Documents.addDocumentNoUI()
Section titled “Documents.addDocumentNoUI()”app.documents.addDocumentNoUI(startupPreset)
Description
Section titled “Description”Creates a document without showing in UI.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
startupPreset | String | Startup preset to use |
Returns
Section titled “Returns”Documents.getByName()
Section titled “Documents.getByName()”app.documents.getByName(name)
Description
Section titled “Description”Gets the first element in the collection with the specified name.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
name | String | Name of element to get |
Returns
Section titled “Returns”Documents.index()
Section titled “Documents.index()”app.documents.index(itemKey)
Description
Section titled “Description”Gets an element from the collection.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
itemKey | String, Number | String or number key |
Returns
Section titled “Returns”Example
Section titled “Example”Creating a new document
Section titled “Creating a new document”// Creates a new document with an RGB color space
app.documents.add(DocumentColorSpace.RGB);