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
events
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 clipboard
var target = { _ref: 'layer', _enum: 'ordinal', _value: 'targetEnum'}
var commands = [{ _obj: 'hide', _target: target }]
await PhotoshopAction.batchPlay(commands)

Parameters:

NameType
commands
ActionDescriptor[]
options?

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
events
notifier
NotificationListener
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.