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
1var idealSize = { width: 200, height: 500 }
2{ width, height} = await PhotoshopCore.calculateDialogSize(idealSize)

Parameters:

preferredSize: object

NameType
heightnumber
widthnumber

Optional identifier: string

Optional minimumSize: object

NameType
heightnumber
widthnumber

endModalToolState

endModalToolState(commit: boolean): Promise‹void›

End the current modal tool editing state.

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

Parameters:

NameType
commitboolean

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
1// can a Fill be performed?
2var canFill = await PhotoshopCore.getMenuCommandState({ commandID: 1042 })

Parameters:

options: object

NameType
commandIDnumber
scheduling?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?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
1// select all
2await PhotoshopCore.performMenuCommand({ commandID: 1017 })

Parameters:

options: object

NameType
commandIDnumber
scheduling?Scheduling

showAlert

showAlert(options: object): Promise‹void›

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

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

Parameters:

options: object

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