Edit in GitHubLog an issue

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;

Index#

Functions#

Functions#

addNotificationListener#

addNotificationListener(events: NotificationEvent[], notifier: NotificationListener): 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([{ event: 'open' }], onOpenNewDocument)

Parameters:

NameType
eventsNotificationEvent[]
notifierNotificationListener

batchPlay#

batchPlay(commands: ActionDescriptor[], options?: BatchPlayCommandOptions): 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

removeNotificationListener#

removeNotificationListener(events: NotificationEvent[], notifier: NotificationListener): Promise‹void›

Detaches a listener from a Photoshop event.

see addNotificationListener

Copied to your clipboard
await PhotoshopAction.removeNotificationListener([{ event: 'open' }], onOpenNewDocument)

Parameters:

NameType
eventsNotificationEvent[]
notifierNotificationListener
Copyright © 2021 Adobe. All rights reserved.