Edit in GitHubLog an issue

Photoshop

The top level application object, root of the Photoshop DOM

Copied to your clipboard
const app = require('photoshop').app

From here you can access open documents, tools, UI elements and run commands or menu items.

Properties#

NameTypeAccessDescription
actionTreeActionSet[]Read-onlyReturns the action tree shown in Actions panel, as an array of ActionSets, each containing actions
activeDocumentDocumentRead-writeThe current active document
backgroundColorSolidColorRead-onlyThe default background color and color style for documents.
currentToolToolRead-onlyCurrent selected tool. For now, the Tool class is an object with only an `id` field. In the future, we aim to provide tools with their own classes
displayDialogsDialogModesRead-writeThe dialog mode for the application, which controls what types of dialogs should be displayed when your plugin is interacting with Photoshop.
documentsDocumentsRead-onlyA list of the documents currently open
fontsTextFontsRead-onlyThe fonts installed on this system.
foregroundColorSolidColorRead-writeThe default foreground color (used to paint, fill, and stroke selections)
typenamestringRead-onlyThe class name of the referenced Photoshop object

Methods#

batchPlay#

Promise<ActionDescriptor[]>

At the heart of all our APIs is batchPlay. It is the evolution of executeAction. It accepts ActionDescriptors deserialized from JS objects, and can play multiple descriptors sequentially without updating the UI. This API is subject to change and may be accessible in other ways in the future.

Parameters#

NameType
commandsany
optionsany

bringToFront#

void

Brings application to focus, useful when your script ends, or requires an input


createDocument#

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

open#

async : Promise<Document>

Opens the specified document and returns it's model

(0.4.0) Please note that this API now requires you to provide a UXPFileEntry

Parameters#

NameType
entry?File

showAlert#

Promise<void>

Shows an alert in Photoshop with the given message

Parameters#

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