Edit in GitHubLog an issue

Documents

A collections class allowing for array access into the applications list of documents that are currently open, while also providing familiar methods from ExtendScript, like getByName

Copied to your clipboard
1// Iterate through all the documents
2app.documents.forEach(h => console.log(h.title));

Hierarchy#

Indexable#

▪ [index: number]: Document

Used to access the documents in the collection

Copied to your clipboard
1// Iterate through all the documents
2app.documents.forEach(h => console.log(h.title));

Properties#

NameTypeAccessDescription
lengthnumberRead-onlyNumber of Document elements in this collection
parentPhotoshopRead-onlyThe owner application of this Documents collection
typenamestringRead-onlyThe name for this object collection: Documents

Methods#

add#

async : Promise<Document>

Create a new document.

No options will create a document of 7 x 5 inches at 300 pixels per inch. This is the same as the "Default Photoshop Size" preset.

An object with a 'preset' string parameter can be used to specify any of the other presets that come installed with Photoshop or created by users.

An object with one or more parameters can also be supplied. Any parameter missing will be set to the default of: width 2100 pixels, height 1500 pixels, resolution 300 pixels per inch, mode: @RGBColorMode and a fill of white with no transparency.

Parameters#

NameTypeDescription
options?DocumentCreateOptions@DocumentCreateOptions

getByName#

Document

Find the first document with the matching name

Parameters#

NameType
namestring
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.