Edit in GitHubLog an issue

The module that allows access to specialized commands within the application. Various application state can be modified or queried here.

Copied to your clipboard
var PhotoshopCore = require('photoshop').core;

Index

Functions

Functions

calculateDialogSize

calculateDialogSize(preferredSize: object, identifier?: string, minimumSize?: object): Promise‹object›

Returns the effective size of a dialog.

Copied to your clipboard
var idealSize = { width: 200, height: 500 }
{ width, height} = await PhotoshopCore.calculateDialogSize(idealSize)

Parameters:

preferredSize: object

NameType
height
number
width
number

Optional identifier: string

Optional minimumSize: object

NameType
height
number
width
number

endModalToolState

endModalToolState(commit: boolean): Promise‹void›

End the current modal tool editing state.

Copied to your clipboard
// close the modal dialog, cancelling changes
await PhotoshopCore.endModalToolState(false)

Parameters:

NameType
commit
boolean

getActiveTool

getActiveTool(): Promise‹object›

Returns information about the active Photoshop tool.

Copied to your clipboard
{ title } = await PhotoshopCore.getActiveTool()

getMenuCommandState

getMenuCommandState(options: object): Promise‹boolean›

Returns whether a command menu item is available for invoking.

Copied to your clipboard
// can a Fill be performed?
var canFill = await PhotoshopCore.getMenuCommandState({ commandID: 1042 })

Parameters:

options: object

NameType
commandID
number
scheduling?

getMenuCommandTitle

getMenuCommandTitle(options: object): Promise‹string›

Returns the localized menu title of the menu command item.

Copied to your clipboard
var renameLayerStr = await PhotoshopCore.getMenuCommandTitle({ commandID: 2983 })

Parameters:

options: object

NameType
commandID?
number
menuID?
number
scheduling?

performMenuCommand

performMenuCommand(options: object): Promise‹boolean›

Invokes the menu command via its commandID. Returns false on failure, or if the command is not available.

Copied to your clipboard
// select all
await PhotoshopCore.performMenuCommand({ commandID: 1017 })

Parameters:

options: object

NameType
commandID
number
scheduling?

showAlert

showAlert(options: object): Promise‹void›

Show a generic alert box to the user. 'OK' to dismiss.

Copied to your clipboard
// script has completed.
await PhotoshopCore.showAlert({ message: 'Operation successful'})

Parameters:

options: object

NameType
message
string
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2026 Adobe. All rights reserved.