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 clipboardvar 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 clipboardawait PhotoshopAction.addNotificationListener([{ event: 'open' }], onOpenNewDocument)
Parameters:
Name | Type |
---|---|
events | NotificationEvent[] |
notifier | NotificationListener |
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 clipboard1var target = { _ref: 'layer', _enum: 'ordinal', _value: 'targetEnum'}2var commands = [{ _obj: 'hide', _target: target }]3await PhotoshopAction.batchPlay(commands)
Parameters:
Name | Type |
---|---|
commands | ActionDescriptor[] |
options? | BatchPlayCommandOptions |
removeNotificationListener
▸ removeNotificationListener(events
: NotificationEvent[], notifier
: NotificationListener): Promise‹void›
Detaches a listener from a Photoshop event.
see
addNotificationListener
Copied to your clipboardawait PhotoshopAction.removeNotificationListener([{ event: 'open' }], onOpenNewDocument)
Parameters:
Name | Type |
---|---|
events | NotificationEvent[] |
notifier | NotificationListener |