Edit in GitHubLog an issue

photoshopAction

The module that facilitates Actions being performed in the UXP-Photoshop world. You may perform your own batchPlay commands, or attach listeners using this module.

Copied to your clipboard
var PhotoshopAction = require('photoshop').action;

Functions#

addNotificationListener#

Promise<void>

Attach a listener to a Photoshop event. A callback in the form of (eventName: string, descriptor: Descriptor) => void will be performed.

Copied to your clipboard
await PhotoshopAction.addNotificationListener(['open'], onOpenNewDocument)

Parameters#

NameType
eventsstring[]
notifierNotificationListener

batchPlay#

Promise<ActionDescriptor[]>

Performs a batchPlay call with the provided commands. Equivalent to an executeAction in ExtendScript.

Copied to your clipboard
1var target = { _ref: 'layer', _enum: 'ordinal', _value: 'targetEnum'}
2var commands = [{ _obj: 'hide', _target: target }]
3await PhotoshopAction.batchPlay(commands)

Parameters#

NameType
commandsActionDescriptor[]
options?BatchPlayCommandOptions

batchPlaySync#

ActionDescriptor[]

Performs a batchPlay call with the provided commands. Equivalent to an executeAction in ExtendScript.

Copied to your clipboard
1var target = { _ref: 'layer', _enum: 'ordinal', _value: 'targetEnum'}
2var commands = [{ _obj: 'hide', _target: target }]
3await PhotoshopAction.batchPlay(commands)

Parameters#

NameType
commandsActionDescriptor[]
options?BatchPlayCommandOptions

removeNotificationListener#

Promise<void>

Detaches a listener from a Photoshop event.

Parameters#

NameType
eventsstring[]
notifierNotificationListener

validateReference#

boolean

Synchronously validates the given action reference, returning true if it still exists. For example, calling this with a closed document would return false.

Parameters#

NameType
refActionReference | ActionReference[]
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.