Photoshop MCP Server

v0.1.0
io.github.zachshallbetter/adobe-mcp-photoshop Checked 10 hours ago Published 1 month ago

Drive Adobe Photoshop from any MCP client: layers, selections, adjustments, type and export.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_documents List Documents

List open documents with their size in pixels, resolution, colour mode, bit depth, file and whether they have unsaved changes

get_document_info Get Document Info

Describe the active document: size in pixels, resolution, mode, bit depth, colour profile, layer count, active layer, channels, guides, selection bounds and history

create_document Create Document

Create a document (File > New, Preset Details) with a size in pixels, resolution, colour mode, bit depth, background fill, pixel aspect ratio and optional colour profile, optionally as an artboard document

ParameterTypeDescription
height *numberPixels
width *numberPixels
artboardbooleanCreate the document with an artboard (the New Document Artboards option). Default false
bitsPerChannelintegerDefault 8
colorProfilestringProfile name, e.g. "sRGB IEC61966-2.1"
fillstringBackground contents. Default white
modestringDefault rgb
namestringDocument name
pixelAspectRationumberPixel width over height for video work, e.g. 0.9 for D1/DV NTSC. Default 1 (square)
resolutionnumberPixels per inch. Default 72

open_document Open Document

Open a file (File > Open, Open As): PSD, PSB, TIFF, JPEG, PNG, GIF, BMP, PDF, EPS, DCS, camera raw and DNG, HEIF, WebP, AVIF, JPEG XL, JPEG 2000, OpenEXR, Radiance, Cineon, DICOM, IFF, PCX, PICT, Pixar, PBM, Scitex CT, Targa, WBMP, Photoshop 2.0, Photoshop Raw, video and audio (as video layers), or a .psdt template (which opens as a new untitled document). openAs reads the file as PDF, EPS, Photoshop Raw or DICOM with that format's options, also when the extension does not match the contents

ParameterTypeDescription
filePath *stringAbsolute path
asSmartObjectbooleanOpen as a smart object. Default false
openAsstringRead the file as this format, with options. pdf: a generic (not Photoshop) PDF page or image, rasterized (Import PDF). eps: rasterize generic EPS. raw: headerless Photoshop Raw data. dicom: medical im…
optionsobjectpdf: select (page|image): open a page or an embedded image. Default page; page (integer 1-100000): page (or image) number, from 1; name (text): name of the new document; cropTo (bounding_box|media_box…

save_document Save Document

Save the active document in place, or at filePath in the format its extension names, with that format's options (File > Save As): PSD, PSB (Large Document Format), TIFF, PNG, JPEG, Photoshop PDF, GIF, Photoshop EPS, DCS 1.0 and 2.0 (.eps with epsType), BMP, Targa (.tga), Pixar (.pxr) or Photoshop Raw (.raw). With asCopy the document keeps referring to its own file

ParameterTypeDescription
alphaChannelsbooleanPSD, TIFF: keep alpha channels
asCopybooleanSave a copy. Default false
compressionTIFF: none, lzw (default), zip or jpeg. PNG: 0-9 (default 6)
embedColorProfilebooleanEmbed the colour profile (PSD, TIFF, JPEG, PDF, EPS, DCS). Default true
epsTypestring.eps files: Photoshop EPS (default), Photoshop DCS 1.0 or DCS 2.0 (CMYK documents; DCS 2.0 keeps spot channels)
filePathstringAbsolute path ending in .psd, .psb, .tif, .tiff, .png, .jpg, .jpeg, .pdf, .gif, .eps, .bmp, .tga, .pxr, .raw. Omit to save in place
formatstringJPEG: baseline, optimized (default) or progressive
interlacedbooleanPNG: interlaced
layersbooleanPSD, TIFF, PDF: keep layers
notesbooleanPSD, TIFF, PDF: save the document's notes with it (the Notes save option)
optionsobjectMore options for the format. TIFF: pixelOrder (interleaved|per_channel); byteOrder (ibm|mac); imagePyramid (true/false); layerCompression (rle|zip); jpegQuality (integer 0-12): with compression jpeg;…
preserveEditingbooleanPDF: keep Photoshop editing capabilities
presetstringPDF: Adobe PDF preset name, e.g. "[High Quality Print]"
qualityintegerJPEG quality, 0-12. Default 10
spotColorsbooleanPSD: keep spot channels
standardstringPDF: PDF/X standard
transparencybooleanTIFF: keep transparency

duplicate_document Duplicate Document

Duplicate the active document (Image > Duplicate), optionally merged into one layer

ParameterTypeDescription
mergeLayersbooleanDuplicate merged layers only. Default false
namestring

set_active_document Set Active Document

Bring an open document to the front by name or index

ParameterTypeDescription
indexinteger
namestring

close_document Close Document

Close the active document. Unsaved changes are discarded unless save is true

ParameterTypeDescription
savebooleanSave before closing. Default false

set_colors Set Colors

Set the foreground and background colours used by fills, strokes, brushes and new documents

ParameterTypeDescription
backgroundstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
foregroundstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"

resize_image Resize Image

Resize the image (Image > Image Size): width and/or height in pixels (the other follows the aspect ratio when omitted), resolution, and the resampling method, with noise reduction for Preserve Details and optionally scaling layer styles (Scale Styles). With resample "none", only the resolution changes and the pixels stay as they are

ParameterTypeDescription
heightnumberPixels
reduceNoisenumberReduce Noise for resample "preserve_details", 0-100
resamplestringDefault automatic
resolutionnumberPixels per inch
scalenumberPercent of the current size, instead of width and height
scaleStylesbooleanScale layer styles with the image (Scale Styles). Given either way, the resize runs through the Image Size command; the aspect ratio is kept, so give width, height or scale, not both width and height
widthnumberPixels

resize_canvas Resize Canvas

Change the canvas size (Image > Canvas Size) in pixels, keeping the image anchored at a side or corner. New areas take the Canvas Extension Color on a background layer (the background colour unless extensionColor is given) and stay transparent elsewhere

ParameterTypeDescription
anchorstringDefault center
extensionColorstringCanvas Extension Color for new areas of a background layer. Default: the background colour
heightnumberPixels (added to the current height when relative)
relativebooleanWidth and height are added to the current size. Default false
widthnumberPixels (added to the current width when relative)

crop_image Crop Image

Crop the image to a rectangle (Image > Crop, or the Crop tool), optionally rotating the crop and resampling the result to a size. Bounds reaching outside the canvas extend it, as dragging the Crop tool past the edge does

ParameterTypeDescription
bounds *objectA rectangle in pixels from the document's top-left corner
anglenumberRotate the crop, in degrees
heightnumberResample the result to this height in pixels
widthnumberResample the result to this width in pixels

trim_image Trim Image

Trim away transparent pixels, or pixels the colour of the top-left or bottom-right corner, from any of the four sides (Image > Trim)

ParameterTypeDescription
basedOnstringDefault transparent
bottomboolean
leftboolean
rightboolean
topboolean

rotate_canvas Rotate Canvas

Rotate the whole image by an angle in degrees (Image > Image Rotation); positive is clockwise. Or flip the canvas horizontally or vertically

ParameterTypeDescription
anglenumber
flipstring

change_mode Change Mode

Convert the image to another colour mode (Image > Mode): RGB, CMYK, Grayscale, Lab, Bitmap, Indexed Color or Multichannel, and/or another bit depth. Indexed Color takes the palette, colours, forced colours, transparency, matte and dither of its dialog; Bitmap (from Grayscale) takes the method, output resolution and halftone screen. Returns the document with its mode. Converting can flatten or discard information

ParameterTypeDescription
bitmapobjectBitmap options (mode "bitmap"; the image must be Grayscale)
bitsPerChannelinteger
indexedobjectIndexed Color options (mode "indexed")
modestring

convert_profile Convert Profile

Convert the image to another colour profile (Edit > Convert to Profile) with a rendering intent, black point compensation and dither

ParameterTypeDescription
profile *stringDestination profile name, e.g. "sRGB IEC61966-2.1", "Working CMYK"
blackPointCompensationboolean
ditherboolean
intentstringDefault relative_colorimetric

flatten_image Flatten Image

Flatten every layer into a background layer (Layer > Flatten Image), or merge only the visible layers (Merge Visible)

ParameterTypeDescription
visibleOnlybooleanMerge visible layers only. Default false

reveal_all Reveal All

Enlarge the canvas to show every pixel that extends beyond it (Image > Reveal All)

set_color_table Set Color Table

Replace the colour table of an Indexed Color image (Image > Mode > Color Table) with a list of colours, in table order

ParameterTypeDescription
colors *arrayUp to 256 colours; each is stored as RGB

set_pixel_aspect_ratio Set Pixel Aspect Ratio

Set the document's pixel aspect ratio (View > Pixel Aspect Ratio), for video work with non-square pixels, and/or toggle View > Pixel Aspect Ratio Correction, which previews the image with those pixels

ParameterTypeDescription
rationumberPixel width divided by height: 1 is square, e.g. 0.91 for D1/DV NTSC, 1.09 for D1/DV PAL, 2 for anamorphic 2:1
toggleCorrectionbooleanToggle Pixel Aspect Ratio Correction (on if it was off, off if it was on)

get_histogram Get Histogram

Read the histogram (Histogram panel) of the composite image or of one channel: the pixel count at each of the 256 levels, with the total, mean and median

ParameterTypeDescription
channelstringChannel name, e.g. "Red" or an alpha channel (list_channels). Default the composite

list_layers List Layers

List the layers and groups, top to bottom, with id, name, kind (pixel, text, smart object, adjustment, shape...), visibility, opacity, blend mode, lock, bounds in pixels and parent group. Ids are what other tools take in target.ids

ParameterTypeDescription
depthintegerHow many group levels to descend. Default all
groupintegerOnly inside this group (id)

create_layer Create Layer

Add a new empty pixel layer or a group above the active layer, or inside a group

ParameterTypeDescription
blendModestring
fillOpacitynumberFill opacity: affects pixels but not layer styles
groupintegerCreate inside this group (id)
namestring
opacitynumber
typestringDefault layer
visibleboolean

set_layer_properties Set Layer Properties

Rename layers and set their opacity, fill opacity, blend mode, visibility and locks

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
blendModestring
fillOpacitynumberFill opacity: affects pixels but not layer styles
lockPixelsbooleanLock image pixels (pixel layers)
lockPositionbooleanLock position (pixel layers)
lockTransparencybooleanLock transparent pixels (pixel layers)
lockedbooleanLock all
namestring
opacitynumber
visibleboolean

set_active_layer Set Active Layer

Make a layer the active one; many commands work on the active layer

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true

arrange_layers Arrange Layers

Change the stacking order: bring to front, bring forward, send backward, send to back, or place above, below or inside another layer or group

ParameterTypeDescription
order *string
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
relativeTointegerLayer or group id, for above, below and inside

group_layers Group Layers

Put layers into a new group (Layer > Group Layers), placed where the first of them was; they keep the order given

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
namestring

ungroup_layers Ungroup Layers

Move a group's layers out to where the group was and remove the empty group (Layer > Ungroup Layers)

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true

duplicate_layers Duplicate Layers

Duplicate layers or groups (Layer > Duplicate Layer), placed above each original, optionally renamed

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
namestringName for the copy (one layer only)

delete_layers Delete Layers

Delete layers or groups (with everything inside them)

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true

merge_layers Merge Layers

Merge a layer into the one below (Merge Down), or merge a group into one layer (Merge Group)

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true

transform_layers Transform Layers

Move layers by dx, dy pixels, scale them by a percentage, rotate them by degrees, or flip them, around an anchor point; optionally transform a copy of each, keeping the original. Video layers transform the same way once they are Smart Objects

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
anchorstringDefault center
anglenumberDegrees, clockwise
duplicatebooleanTransform a copy of each layer, placed above it. Default false
dxnumber
dynumber
flipstring
scaleXnumberPercent; negative flips
scaleYnumberPercent; negative flips

rasterize_layers Rasterize Layers

Rasterize type, shape, smart object or fill layers into pixels (Layer > Rasterize), or only one part of them

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
whatstringDefault entire_layer

convert_background_layer Convert Background Layer

Turn the background layer into a normal layer that can move and hold transparency, or make a layer the background

ParameterTypeDescription
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
toBackgroundbooleanMake the target the background layer. Default false: turn the background into a normal layer

layer_comps Layer Comps

Work with layer comps (Layer Comps panel): list, create, apply, update (recapture) or delete one; apply the previous or next comp; change a comp's options (Layer Comp Options); duplicate a comp; go back to the Last Document State; or clear a comp's warning (Clear Layer Comp Warning; every comp when no name is given)

ParameterTypeDescription
action *string
appearancebooleancreate, options: record layer appearance (layer styles)
commentstringcreate, options: the comp's comment
namestringThe comp to act on (create: the new comp's name)
newNamestringoptions: rename the comp to this; duplicate: name for the copy
positionbooleancreate, options: record layer position
visibilitybooleancreate, options: record layer visibility

new_layer_via New Layer Via

Make a new layer from existing pixels (Layer > New): Layer via Copy copies the selected pixels (or the whole layer when nothing is selected) to a new layer; Layer via Cut moves the selected pixels to a new layer; Stamp Visible merges a copy of every visible layer into a new layer above the target and keeps the originals

ParameterTypeDescription
method *string
namestringName for the new layer
targetobjectThe one layer to copy or cut from, or to stamp above. Default the active layer

set_layer_selection Set Layer Selection

Select several layers at once in the Layers panel, for commands that act on the selected layers: set or add to the selection, select All Layers, Deselect Layers, Select Linked Layers, Similar Layers (same kind as the target), or find layers whose names contain some text (Select menu). Returns the selected layers

ParameterTypeDescription
action *stringset: select exactly the target layers; add: add them; all, none; linked and similar: start from the target layer; find: select layers whose name contains query
querystringfind: text the layer name contains, ignoring case
targetobjectset and add: the layers; linked and similar: the layer to start from (default the active layer)

process_all_layers Process All Layers

Run a command on every layer of the document: Delete Hidden Layers (Layers panel menu) or Rasterize All Layers (Layer > Rasterize > All Layers)

ParameterTypeDescription
action *string

lock_layers Lock Layers

Apply locks to layers, optionally to every layer inside the target groups (Layer > Lock Layers, Lock All Layers in Group). Locks not listed are turned off; an empty list unlocks

ParameterTypeDescription
locks *arrayall, pixels (image pixels), position, transparency (transparent pixels), artboard (prevent auto-nesting). [] unlocks
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
includeGroupContentsbooleanAlso lock every layer inside target groups

set_layers_panel_view Set Layers Panel View

Change what the Layers panel shows, without changing the document: Isolate Layers (show only the target layers), Remove from Isolation, or Collapse All Groups

ParameterTypeDescription
action *string
targetobjectisolate: the layers to show. Default the active layer

reverse_layer_order Reverse Layer Order

Reverse the stacking order of two or more layers (Layer > Arrange > Reverse)

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true

apply_matting Apply Matting

Clean the edge pixels of a pixel layer (Layer > Matting): Defringe (replace fringe colours over a width in pixels), Remove Black Matte, Remove White Matte, or Color Decontaminate

ParameterTypeDescription
method *string
targetobjectPixel layers. Default the active layer
widthnumberdefringe: width in pixels. Default 1

copy_layer_code Copy Layer Code

Copy CSS for shape and type layers (size, position, colours, gradients, shadows, type settings), or SVG markup for a shape layer, to the clipboard (Layers panel context menu: Copy CSS, Copy SVG)

ParameterTypeDescription
format *string
targetobjectDefault the active layer

edit_layer_mask Edit Layer Mask

Work with layer masks (Layer > Layer Mask and the Layers panel): add a mask (Reveal All, Hide All, Reveal Selection or Hide Selection), apply it to the pixels, delete it, disable or enable it, link or unlink it from the layer, invert it, target the mask or the layer content for editing, load the mask as a selection, or copy or move it to another layer

ParameterTypeDescription
action *string
invertbooleanload_selection: select the hidden area instead
revealstringadd: what the new mask shows. Default reveal_selection when there is a selection, otherwise reveal_all
showAlonebooleantarget_mask: show the mask by itself in the document window
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer
tointegercopy_to, move_to: id of the layer that receives the mask; it must not have one

set_mask_properties Set Mask Properties

Set the Density (opacity) and Feather of a layer's layer mask, vector mask or smart-filter mask (Properties panel, masks)

ParameterTypeDescription
densitynumberPercent
feathernumberPixels
maskstringWhich mask. Default layer
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

edit_vector_mask Edit Vector Mask

Work with vector masks (Layer > Vector Mask): make one from a path (Current Path), disable or enable it, or delete it. Rasterize a vector mask with rasterize_layers

ParameterTypeDescription
action *string
pathstringcreate_from_path: the path's name in the Paths panel. Default the selected path or work path
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

set_clipping_mask Set Clipping Mask

Clip layers to the layer below them (Layer > Create Clipping Mask), so they show only where it has pixels, or release them (Layer > Release Clipping Mask)

ParameterTypeDescription
action *string
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true

set_quick_mask Set Quick Mask

Turn Quick Mask Mode on (the selection becomes a red overlay that painting edits) or off (the overlay becomes the selection again)

ParameterTypeDescription
enabled *booleantrue enters Quick Mask Mode, false leaves it

refine_mask Refine Mask

Refine a layer mask's edges as Select and Mask does, writing the result back to the layer mask. Without a mask, the current selection is refined into a new mask

ParameterTypeDescription
contrastnumberPercent. Default 0
feathernumberPixels. Default 0
radiusnumberEdge detection radius in pixels. Default 0
shiftEdgenumberPercent; negative moves the edge in. Default 0
smartRadiusbooleanSmart Radius
smoothintegerDefault 0
targetobjectOne layer. Default the active layer

mask_by_color_range Mask By Color Range

Make a layer's mask from a colour range (Properties panel, masks: Color Range): a sampled colour with a fuzziness, or a preset range such as reds, highlights or skin tones. Replaces the layer's existing mask

ParameterTypeDescription
colorstringsampled: the colour to keep. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
colorsstringDefault sampled
fuzzinessintegersampled: how far from the colour still counts. Default 40
invertbooleanMask out the range instead of keeping it
targetobjectOne layer. Default the active layer

convert_to_smart_object Convert To Smart Object

Bundle layers into one embedded smart object (Layer > Smart Objects > Convert to Smart Object), or convert a layer so filters applied to it stay editable as Smart Filters (Filter > Convert for Smart Filters)

ParameterTypeDescription
namestringName for the smart object layer
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

get_smart_object_info Get Smart Object Info

Describe smart object layers: whether they are linked or embedded, their source file, the layer comps of the placed document and which one shows, and their Smart Filters in order with whether each is on

ParameterTypeDescription
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

edit_smart_object Edit Smart Object

Smart object commands (Layer > Smart Objects): New Smart Object via Copy, Edit Contents (opens the source as the active document; save and close it to update the layer), Replace Contents, Export Contents, Relink to File (also resolves a broken link), Update Modified Content, Update All Modified Content, Embed Linked, Embed All Linked, Convert to Linked, Reset Transform, Convert to Layers, and choosing which layer comp of the placed document shows (Properties panel)

ParameterTypeDescription
action *string
compstringset_layer_comp: name of a layer comp in the placed document (get_smart_object_info lists them)
filestringAbsolute path. replace_contents and relink: the source file to use; export_contents and convert_to_linked: the file to write
pageintegerreplace_contents: page of a multi-page file (PDF, Illustrator)
targetobjectOne smart object layer. Default the active layer

set_stack_mode Set Stack Mode

Render a multi-layer smart object with a statistical stack mode (Layer > Smart Objects > Stack Mode), for example median to remove moving objects or mean to reduce noise. Give several aligned layers and they are first converted into one smart object (an image stack)

ParameterTypeDescription
mode *string
targetobjectA smart object, or the layers to stack. Default the active layer

set_smart_filter_visibility Set Smart Filter Visibility

Turn one Smart Filter on a smart object, or all of them, off or on (the eye icons under the layer in the Layers panel)

ParameterTypeDescription
visible *booleantrue shows, false hides
indexintegerWhich filter, 1 = the first listed by get_smart_object_info. Default all
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

set_layer_effects Set Layer Effects

Add, change, hide or remove layer style effects (Layer > Layer Style), as the Layer Style dialog does. effects maps each effect to an options object (omitted options keep the current settings, or Photoshop's defaults for a new effect), true (add or keep with defaults), false (delete the effect), or for dropShadow, innerShadow, colorOverlay, gradientOverlay and stroke a list (several instances, each from defaults). enabled: false hides one effect. Options by effect: dropShadow (enabled, blendMode, color, opacity, angle, useGlobalLight, distance, spread, size, contour, antiAlias, noise, knocksOu…

ParameterTypeDescription
effects *objectFor example { dropShadow: { distance: 8, size: 12 }, stroke: { size: 2, color: "#FFFFFF" }, outerGlow: false }
replacebooleanStart from an empty style, dropping effects not given
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

get_layer_effects Get Layer Effects

Describe layers' styles: whether effects are shown, and each effect and instance with whether it is on and, with detail, all its settings

ParameterTypeDescription
detailbooleanInclude every setting of each effect
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

copy_layer_style Copy Layer Style

Copy one layer's style to other layers (Layer > Layer Style > Copy Layer Style, then Paste Layer Style, which replaces their styles), or copy only some effects, added to their own styles as Option/Alt-dragging an effect does

ParameterTypeDescription
source *objectThe one layer to copy from
target *objectThe layers to paste onto
effectsarrayCopy only these effects (every instance), replacing the same effects on the targets. Default the whole style

manage_layer_style Manage Layer Style

Layer style commands (Layer > Layer Style): Clear Layer Style, Rasterize Layer Style (bake the effects into pixels), Scale Effects by a percentage, or hide or show all of a layer's effects

ParameterTypeDescription
action *string
scalenumberscale: percent
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer

set_blending_options Set Blending Options

Set a layer's Blending Options (Layer Style dialog): blend mode, opacity and fill opacity; Advanced Blending knockout, the channels it blends into and the group options (Blend Interior Effects as Group, Blend Clipped Layers as Group, Transparency Shapes Layer, Layer Mask Hides Effects, Vector Mask Hides Effects); and Blend If ranges for this layer and the underlying layer

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
blendClippedLayersbooleanblend clipped layers
blendIfarrayBlend If, one entry per channel: { channel: "gray" or a colour channel, thisLayer: [black, black split, white split, white], underlyingLayer: [...] }, levels 0-255
blendInteriorEffectsbooleanblend interior effects
blendModestringBlend mode
channelsarrayChannels the layer blends into, e.g. ["red", "blue"]; the document's own channel names
fillOpacitynumberFill opacity, percent (pixel, type and shape layers)
knockoutstringKnockout
layerMaskHidesEffectsbooleanlayer mask hides effects
opacitynumberPercent
transparencyShapesLayerbooleantransparency shapes layer
vectorMaskHidesEffectsbooleanvector mask hides effects

manage_style_presets Manage Style Presets

Use the Styles panel: apply a loaded style preset to layers by name (replacing their styles), load a style library (.asl) into the panel, or save the panel's styles as a library (Styles panel menu: Load Styles, Save Styles)

ParameterTypeDescription
action *string
appendbooleanload: add to the current styles (false replaces them)
filestringload, save: absolute path of the .asl file
stylestringapply: the style's name in the Styles panel
targetobjectapply: the layers. Default the active layer

select_area Select Area

Select a rectangle, an ellipse, a polygon or freehand outline (the Polygonal Lasso and Lasso tools), or a one-pixel row or column (Single Row and Single Column Marquee tools), in pixels from the document's top-left corner, combined with the current selection. The ellipse is a fine polygon, so its edge is close to but not exactly the Elliptical Marquee's

ParameterTypeDescription
antiAliasboolean
boundsobjectRectangle or ellipse bounds
combinestringHow it combines with the current selection. Default replace
feathernumberPixels. Default 0
pointsarrayPolygon or lasso outline, [[x, y], ...]
shapestringDefault rectangle
xnumbercolumn: the column's left edge, pixels from the left
ynumberrow: the row's top edge, pixels from the top

select_all Select All

Select the whole canvas (Select > All), deselect (Select > Deselect), or invert the selection (Select > Inverse)

ParameterTypeDescription
action *string

modify_selection Modify Selection

Modify the selection (Select > Modify): expand, contract, feather, smooth or border by pixels; grow or select similar colours by tolerance

ParameterTypeDescription
amount *numberPixels (radius or width); tolerance 0-255 for grow and similar
operation *string

transform_selection Transform Selection

Move, scale or rotate the selection outline (Select > Transform Selection), or the selected pixels themselves

ParameterTypeDescription
anglenumber
dxnumber
dynumber
pixelsbooleanTransform the selected pixels, not just the outline. Default false
scaleXnumberPercent
scaleYnumberPercent

fill_selection Fill Selection

Fill the selection on the active layer with a colour (Edit > Fill), with a blend mode, opacity and optionally preserving transparency

ParameterTypeDescription
blendModestringDefault normal
colorstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Default the foreground colour
opacitynumber
preserveTransparencyboolean

stroke_selection Stroke Selection

Stroke the selection's edge on the active layer (Edit > Stroke): colour, width in pixels, inside, centre or outside, blend mode and opacity

ParameterTypeDescription
width *number
blendModestringDefault normal
colorstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Default the foreground colour
locationstringDefault center
opacitynumber
preserveTransparencyboolean

save_selection Save Selection

Store the selection in an alpha channel (Select > Save Selection), or load a channel as the selection (Select > Load Selection), combined with the current one

ParameterTypeDescription
action *string
channel *stringAlpha channel name. Saving to a new name creates the channel
combinestringHow it combines with the current selection. Default replace
invertbooleanLoad: invert the channel. Default false

clipboard Clipboard

Copy, copy merged, cut or clear the selection on the active layer, or paste as a new layer: paste, paste_into the selection, paste_in_place (Edit > Paste Special > Paste in Place: at the copied pixels' original position) or paste_outside the selection (Paste Outside: the selection is masked out)

ParameterTypeDescription
action *stringWhat to do

activate_tool Activate Tool

Choose a tool in the Tools panel, such as a marquee, lasso, Quick Selection, Magic Wand, Crop, Perspective Crop, Eyedropper, Color Sampler, Ruler or Count tool, so it is ready for the user. Using a tool on the canvas is the user's; select_area, crop_image and manage_count_items do the same work by numbers

ParameterTypeDescription
tool *string

select_color_range Select Color Range

Select by colour (Select > Color Range): pixels near a sampled colour within a fuzziness, or a preset range (reds ... magentas, highlights, midtones, shadows, out of gamut), optionally inverted. Works inside the current selection when there is one, and samples the active layer

ParameterTypeDescription
colorstringThe colour to select (Sampled Colors). "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
fuzzinessintegerSampled colours and highlights/midtones/shadows: how far from the colour or tone still counts. Default 40
invertbooleanSelect everything else. Default false
presetstringA preset range instead of a colour
rangearrayhighlights, midtones or shadows: the [lower, upper] tonal limits, 0-255

select_content Select Content

Select automatically: the main subject (Select > Subject), the sky (Select > Sky), or the in-focus areas with Focus Area's automatic settings (Select > Focus Area). Subject uses the device or cloud processing chosen in Preferences > Image Processing

ParameterTypeDescription
what *string
sampleAllLayersbooleansubject and sky: look at every layer, not only the active one. Default false

refine_selection Refine Selection

Refine the selection's edge as Select and Mask does, without opening the workspace: edge detection radius (optionally smart), smooth, feather, contrast, shift edge and colour decontamination, output to the selection, a layer mask, a new layer or a new document

ParameterTypeDescription
contrastnumberPercent. Default 0
decontaminatebooleanDecontaminate Colors (needs an output to a new layer or document). Default false
decontaminateAmountnumberPercent. Default 100
feathernumberPixels. Default 0
outputstringDefault selection
radiusintegerEdge detection radius, pixels. Default 0
sampleAllLayersbooleanDefault false
shiftEdgenumberPercent; negative moves the edge inward. Default 0
smartRadiusbooleanSmart Radius. Default false
smoothintegerDefault 0

select_layer_pixels Select Layer Pixels

Load layers' transparency as the selection, as Cmd/Ctrl-clicking a layer thumbnail does: replace, add to, subtract from or intersect with the current selection. With several layers, replace selects all of their pixels together

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
combinestringHow it combines with the current selection. Default replace

list_channels List Channels

List the Channels panel: each channel's name, kind (component, alpha masked or selected areas, spot colour), visibility, opacity or spot solidity, colour, and whether it is targeted

create_channel Create Channel

Add an alpha channel (Channels panel > New Channel) whose colour shows masked or selected areas, or a spot colour channel (New Spot Channel) with its ink colour and solidity; optionally filled from the selection (Save Selection as Channel)

ParameterTypeDescription
colorstringOverlay colour of an alpha channel, or ink colour of a spot channel. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "la…
fromSelectionbooleanFill the channel from the current selection. Default false
kindstringDefault masked_areas (an alpha channel)
namestringChannel name; spot channels are usually named after the ink
opacitynumberOverlay opacity of an alpha channel, or Solidity of a spot channel, percent

set_channel Set Channel

Change a channel's options (Channels panel > Channel Options): name, kind (converting an alpha channel to a spot channel or back), colour, opacity or solidity, and show or hide it (the eye icon). Colour channels such as Red can only be shown or hidden

ParameterTypeDescription
channel *stringThe channel's current name (list_channels)
colorstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
kindstring
namestring
opacitynumberPercent
visibleboolean

manage_channels Manage Channels

Target channels for editing (clicking them in the Channels panel), duplicate a channel (into this or another open document), delete alpha or spot channels, or merge spot channels into the colour channels (Merge Spot Channel, which flattens the image)

ParameterTypeDescription
action *string
channels *arrayChannel names (list_channels)
namestringduplicate: name for the copy (one channel)
toDocumentstringduplicate: an open document of the same pixel size to copy into. Default this one

split_channels Split Channels

Split the image into one grayscale document per channel (Channels panel > Split Channels). The original closes; the image must be flattened first (flatten_image)

merge_channels Merge Channels

Combine open grayscale documents of the same pixel size into one image (Channels panel > Merge Channels): three into RGB or Lab, four into CMYK, or two or more into Multichannel, in channel order (e.g. red, green, blue)

ParameterTypeDescription
documents *arrayOpen grayscale document names, in channel order
modestringDefault rgb

apply_image Apply Image

Blend a source layer and channel, from this or another open document of the same pixel size, into the active layer (Image > Apply Image), with a blending mode, opacity, invert and preserve transparency; add and subtract take scale and offset. Works inside the selection when there is one

ParameterTypeDescription
blendModestringDefault normal
offsetintegeradd and subtract: add this brightness. Default 0
opacitynumberPercent. Default 100
preserveTransparencybooleanDefault false
scalenumberadd and subtract: divide the result by this. Default 1
sourceobjectA source channel
targetobjectThe layer to change. Default the active layer

calculate_channels Calculate Channels

Blend two source channels into a new alpha channel (Image > Calculations): each source is a layer (or merged) and channel, from this or another open document of the same pixel size, optionally inverted; with a blending mode and opacity

ParameterTypeDescription
source1 *objectA source channel
source2 *objectA source channel
blendModestringDefault multiply
namestringName for the new channel
opacitynumberPercent. Default 100

align_layers Align Layers

Align layers by their top, vertical centre, bottom, left, horizontal centre or right edges (Layer > Align), or distribute them evenly by those edges (Layer > Distribute; three or more layers). With toSelection, align them to the selection (Layer > Align Layers To Selection)

ParameterTypeDescription
edge *string
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
distributebooleanDistribute instead of align. Default false
toSelectionbooleanAlign to the current selection. Default false; Photoshop aligns to a selection whenever there is one, so without toSelection the call refuses when something is selected

auto_align_layers Auto Align Layers

Line up overlapping photos of the same scene (Edit > Auto-Align Layers) by their content, with the Auto or Perspective projection, optionally removing vignetting and correcting geometric distortion. Pixel layers only: not adjustment, vector or Smart Object layers

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
geometricDistortionbooleanGeometric Distortion correction. Default false
projectionstringDefault auto
removeVignettebooleanVignette Removal. Default false

auto_blend_layers Auto Blend Layers

Blend aligned layers into one seamless image (Edit > Auto-Blend Layers): a panorama, or a focus stack that keeps the sharpest areas of each layer, with Seamless Tones and Colors. RGB or Grayscale; not for Smart Objects, video, 3D or the background layer

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
methodstringDefault panorama
seamlessTonesbooleanSeamless Tones and Colors. Default true

apply_transform Apply Transform

Transform layers or a path numerically, as Free Transform's options bar does: move, scale, rotate and skew (Edit > Transform > Skew) around a reference point; repeat the last transform (Edit > Transform > Again); or transform a duplicate, keeping the original. With path, transforms the path's points (Edit > Transform Path)

ParameterTypeDescription
againbooleanRepeat the last transform instead of giving values (Transform Again)
anchorstringReference point. Default center
anglenumberDegrees, clockwise
duplicatebooleanLayers: transform a copy of each layer, placed above it. Default false
dxnumberMove right, pixels
dynumberMove down, pixels
pathstringA path name (Paths panel) to transform instead of layers
scaleXnumberWidth, percent; negative flips
scaleYnumberHeight, percent; negative flips
skewXnumberHorizontal skew, degrees
skewYnumberVertical skew, degrees
targetobjectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Each layer transforms around its own reference point

warp_layers Warp Layers

Warp layers with a preset style (Edit > Transform > Warp): arc, arch, bulge, flag, wave, fisheye, twist and the rest, with bend and horizontal and vertical distortion in percent, horizontal or vertical. Warping a Smart Object stays editable

ParameterTypeDescription
style *string
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
bendnumberPercent. Default 50
horizontalDistortionnumberPercent. Default 0
orientationstringDefault horizontal
verticalDistortionnumberPercent. Default 0

warp_perspective Warp Perspective

Correct or change a layer's perspective (Edit > Perspective Warp) with one quad: four corners in the image move to four new positions, e.g. to square up a photographed sign. Corners go top-left, top-right, bottom-right, bottom-left, in pixels. Needs the graphics processor enabled

ParameterTypeDescription
from *arrayThe quad's corners in the image now, [[x, y] x 4]
target *objectOne layer
to *arrayWhere those corners go, [[x, y] x 4]

scale_content_aware Scale Content Aware

Resize a layer while keeping important content such as people and buildings unchanged (Edit > Content-Aware Scale): width and height in percent, the Amount of content-aware against normal scaling, Protect Skin Tones, and an alpha channel to protect

ParameterTypeDescription
target *objectOne layer
amountnumberPercent of content-aware scaling. Default 100
anchorstringReference point. Default center
protectChannelstringAlpha channel whose white areas are protected (list_channels)
protectSkinTonesbooleanDefault false
scaleXnumberWidth, percent. Default 100
scaleYnumberHeight, percent. Default 100

set_measurement_scale Set Measurement Scale

Set the document's measurement scale (Image > Analysis > Set Measurement Scale): how many pixels make a length in logical units, e.g. 100 pixels = 2 millimeters. Without arguments, returns the current scale

ParameterTypeDescription
logicalLengthnumberThe length those pixels stand for
logicalUnitsstringUnit name, e.g. "mm", "microns", "km"
namestringName for this scale preset
pixelLengthnumberPixels
resetbooleanReset to the default: 1 pixel = 1 pixel

record_measurements Record Measurements

Record measurements to the Measurement Log (Image > Analysis > Record Measurements) from the selection, the Ruler tool's line or the Count tool's items, with a chosen set of data points. The ruler source needs a line drawn with the Ruler tool

ParameterTypeDescription
dataPointsarrayData points (Image > Analysis > Select Data Points), by their names in the Measurement Log, e.g. "Area", "Perimeter", "Count", "Length", "Angle". Default: the current choice
sourcestringWhat to measure. Default selection

manage_measurement_log Manage Measurement Log

Work with the Measurement Log panel (Window > Measurement Log): export all or the selected measurements to a tab-delimited text file, delete them, select or deselect all rows, toggle Auto Display Panel, or show or hide the panel

ParameterTypeDescription
action *string
dataPointsarrayData points (Image > Analysis > Select Data Points), by their names in the Measurement Log, e.g. "Area", "Perimeter", "Count", "Length", "Angle". Default: the current choice
filePathstringexport: absolute path of a .txt or .csv file
rangestringexport and delete: all rows or the selected ones. Default all

manage_count_items Manage Count Items

List, add, remove or clear the Count tool's numbered markers (count items) in the document. Positions are pixels from the top-left corner; indexes start at 0

ParameterTypeDescription
action *string
indexintegerremove: the count item's index
pointsarrayadd: positions, [[x, y], ...]

adjust_layers Adjust Layers

Apply an Image > Adjustments command to pixel layers (inside the selection, if there is one). This changes the pixels; it does not add an adjustment layer. auto_color_correction applies Auto with an algorithm from Auto Color Correction Options, once; match_color adjusts the layer on its own (Match Color with Source: None, RGB only); replace_color changes one colour and the colours within its fuzziness (Replace Color). Options by type: brightness_contrast (brightness, contrast, useLegacy); levels (inputBlack, inputWhite, gamma, outputBlack, outputWhite, channel, auto); curves (points, channel);…

ParameterTypeDescription
adjustment *string
optionsobjectSettings for the chosen type; omitted settings use the defaults Photoshop opens its dialog with
targetobjectPixel layers. Default the active layer

apply_filter Apply Filter

Apply a filter from the Filter menu to pixel layers (inside the selection, if there is one). The Filter Gallery filters (Artistic, Brush Strokes, Sketch, Texture, glowing_edges), filter_gallery (the whole gallery stack), shape_blur, mezzotint and adaptive_wide_angle have no options here: they use the settings last used in their dialog or the Filter Gallery. diffuse, extrude and lens_correction (Filter > Lens Correction) apply only the settings given; the rest keep the values last used in the dialog. Filters without an object-model method act through the active layer, which ends on the last tar…

ParameterTypeDescription
filter *string
optionsobjectSettings for the chosen type; omitted settings use the defaults Photoshop opens its dialog with
targetobjectPixel layers. Default the active layer

create_adjustment_layer Create Adjustment Layer

Add an adjustment layer above the active layer (Layer > New Adjustment Layer, or the Adjustments panel), with its settings, optionally clipped to the layer below. Adjustment layers change the look of the layers beneath without changing their pixels. Options by type: brightness_contrast (brightness, contrast, useLegacy); levels (channel, inputBlack, inputWhite, gamma, outputBlack, outputWhite, auto); curves (channel, points); exposure (exposure, offset, gamma); vibrance (vibrance, saturation); color_and_vibrance (temperature, tint, vibrance, saturation); hue_saturation (hue, saturation, lightne…

ParameterTypeDescription
type *stringAdjustment type
aboveobjectAdd it above this layer (the first match) instead of the active layer
blendModestringBlend mode
clipbooleanUse Previous Layer to Create Clipping Mask: affect only the layer below
namestringLayer name. Default Photoshop's (e.g. "Levels 1")
opacitynumberLayer opacity, percent
optionsobjectSettings for the chosen type; see the list in this tool's description. Omitted settings use Photoshop's defaults

edit_adjustment_layer Edit Adjustment Layer

Change the settings of existing adjustment layers (the Properties panel). Only the options given change; the rest keep their values. Also sets name, opacity, blend mode and clipping. Options by type: brightness_contrast (brightness, contrast, useLegacy); levels (channel, inputBlack, inputWhite, gamma, outputBlack, outputWhite, auto); curves (channel, points); exposure (exposure, offset, gamma); vibrance (vibrance, saturation); color_and_vibrance (temperature, tint, vibrance, saturation); hue_saturation (hue, saturation, lightness, colorize, ranges); color_balance (shadows, midtones, highlights…

ParameterTypeDescription
target *objectAdjustment layers of the given type
type *stringTheir adjustment type
blendModestringBlend mode
clipbooleanUse Previous Layer to Create Clipping Mask: affect only the layer below
namestringLayer name. Default Photoshop's (e.g. "Levels 1")
opacitynumberLayer opacity, percent
optionsobjectSettings for the chosen type; see the list in this tool's description. Omitted settings use Photoshop's defaults

create_fill_layer Create Fill Layer

Add a fill layer above the active layer (Layer > New Fill Layer): a solid colour, a gradient (defined as in the Gradient Editor) or a pattern, optionally clipped to the layer below. Options by type: solid_color (color); gradient (gradient, style, angle, scale, reverse, dither, alignWithLayer, method, offset); pattern (pattern, patternId, scale, linked).

ParameterTypeDescription
type *stringFill type
aboveobjectAdd it above this layer (the first match) instead of the active layer
blendModestringBlend mode
clipbooleanUse Previous Layer to Create Clipping Mask: affect only the layer below
namestringLayer name. Default Photoshop's (e.g. "Levels 1")
opacitynumberLayer opacity, percent
optionsobjectSettings for the chosen fill. solid_color needs color; pattern needs pattern (a name); see the list in this tool's description. Omitted settings use Photoshop's defaults

edit_fill_layer Edit Fill Layer

Change existing fill layers: colour, gradient and its placement, or pattern (double-clicking the layer thumbnail). Only the options given change. Options by type: solid_color (color); gradient (gradient, style, angle, scale, reverse, dither, alignWithLayer, method, offset); pattern (pattern, patternId, scale, linked).

ParameterTypeDescription
target *objectFill layers of the given type
type *stringTheir fill type
blendModestringBlend mode
clipbooleanUse Previous Layer to Create Clipping Mask: affect only the layer below
namestringLayer name. Default Photoshop's (e.g. "Levels 1")
opacitynumberLayer opacity, percent
optionsobjectSettings for the chosen fill; see the list in this tool's description. Omitted settings use Photoshop's defaults

swap_colors Swap Colors

Switch the foreground and background colours (Switch Foreground and Background Colors, X), or with reset: true return them to black and white (Default Foreground and Background Colors, D)

ParameterTypeDescription
resetbooleanReset to black foreground and white background instead of switching. Default false

pick_color Pick Color

Work with a colour the way the Color Picker and Color panel do: give a colour in any model (or read the current foreground or background colour) and get its HSB, RGB, Lab, CMYK, grayscale and hex values, whether it is web-safe and the nearest web-safe colour (Only Web Colors); optionally snap it to web-safe and make it the foreground or background colour

ParameterTypeDescription
colorstringThe colour. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
fromstringUse the current foreground or background colour instead of color
setAsstringMake the result the foreground or background colour
webSafebooleanSnap to the nearest web-safe colour (Only Web Colors)

sample_color Sample Color

Read pixel colours of the composite image at points (Color Sampler tool and Info panel), optionally making the first the foreground or background colour (Eyedropper tool) and keeping the samplers in the document

ParameterTypeDescription
points *arrayPixel positions from the document's top-left
clearbooleanRemove the document's existing colour samplers first. Default false
keepbooleanLeave colour samplers at the points. Default false
setAsstringMake the first sampled colour the foreground or background colour (Eyedropper)

define_pattern Define Pattern

Save the selection, an area or the whole image as a pattern (Edit > Define Pattern), for pattern fill layers and fills. The area must be a plain rectangle; without one, the selection is used, or the whole image when nothing is selected

ParameterTypeDescription
name *stringPattern name
boundsobjectRectangle to use, in pixels; selected first and deselected afterwards

assign_profile Assign Profile

Assign a colour profile to the active document without converting its colour values (Edit > Assign Profile): a profile name, the working space, or none (Don't Color Manage). Use convert_profile to keep the appearance instead

ParameterTypeDescription
profile *stringProfile name, e.g. "Adobe RGB (1998)", or "working" for the working space, or "none"

set_color_preferences Set Color Preferences

Choose the colour settings file (Edit > Color Settings, e.g. "North America General Purpose 2"), Dynamic Color Sliders (Color panel) and the Gamut Warning opacity (Preferences > Transparency & Gamut); returns the current values. With no arguments it only reads them

ParameterTypeDescription
dynamicColorSlidersbooleanDynamic Color Sliders
gamutWarningOpacitynumberGamut Warning opacity, percent
settingsstringName of a colour settings file (as in the Color Settings Settings menu)

set_proof_view Set Proof View

Soft-proof the active document: choose a Proof Setup preset (View > Proof Setup: working CMYK or one plate, legacy Mac RGB, sRGB, monitor RGB, colour-blindness types), and toggle View > Proof Colors and View > Gamut Warning. The toggles switch the current state, which scripts cannot read

ParameterTypeDescription
presetstringProof Setup preset
toggleGamutWarningbooleanToggle Gamut Warning
toggleProofColorsbooleanToggle Proof Colors

repeat_last_filter Repeat Last Filter

Apply the last filter again, with the same settings, to layers (Filter > Last Filter). A filter must have been applied in this Photoshop session

ParameterTypeDescription
targetobjectLayers. Default the active layer

fade_filter Fade Filter

Fade the filter, adjustment or paint stroke just applied: blend it with what was there before at an opacity and blend mode (Edit > Fade). Only works directly after that edit

ParameterTypeDescription
opacity *numberPercent of the edit to keep
modestringBlend mode. Default normal

fill_contents Fill Contents

Fill the selection (or the whole layer when nothing is selected) on the active layer with the foreground or background colour, black, 50% gray, white, a pattern, a History state, or Content-Aware fill (Edit > Fill). A pattern fill can run one of the scripted patterns Photoshop ships (Edit > Fill > Pattern > Script: Brick Fill, Cross Weave, Place Along Path, Random Fill, Symmetry Fill) with its settings given here instead of in its dialog. Content-Aware needs a selection and fills it directly, without the Content-Aware Fill workspace. For a specific colour use fill_selection

ParameterTypeDescription
contents *stringWhat to fill with; gray is 50% gray
blendModestringBlend mode. Default normal
colorAdaptationbooleanContent-Aware: blend the fill's colour with its surroundings. Default true
historyIndexintegerHistory state to fill from (list_history), for contents history. Default 0, the opening state
mirrorbooleanContent-Aware: allow mirrored samples. Default false
opacitynumberPercent. Default 100
patternstringPattern name (from the Patterns panel), for contents pattern
preserveTransparencybooleanLeave transparent pixels transparent. Default false
rotationAdaptationbooleanContent-Aware: allow rotated samples. Default false
scalebooleanContent-Aware: allow scaled samples. Default false
scriptstringContents pattern: lay the pattern out with this scripted pattern (the Script option)
scriptOptionsobjectWith script: the script's settings; any left out keep the script's defaults, and values beyond what the script allows are clamped. brick_fill: patternScale, spacing, offset, colorRandomness, brightnes…
scriptPathstringWith script place_along_path (required) or random_fill: the path in the Paths panel to place the pattern along

draw_gradient Draw Gradient

Draw a classic gradient on the active layer, inside the selection if there is one, from one point to another (Gradient tool in Classic gradient mode): linear, radial, angle, reflected or diamond, with colour and opacity stops, reverse, dither, transparency and interpolation. Without colours it runs from the foreground to the background colour

ParameterTypeDescription
from *objectStart point, pixels from the top-left
to *objectEnd point, pixels from the top-left
blendModestringBlend mode. Default normal
colorsarrayColour stops. Default foreground to background
ditherbooleanDither to reduce banding. Default true
interpolationstringHow colours blend between stops. Default perceptual
opacitiesarrayOpacity stops. Default fully opaque throughout
opacitynumberPercent. Default 100
reversebooleanReverse the colour order. Default false
transparencybooleanUse the opacity stops (the Transparency option). Default true
typestringDefault linear

stroke_path Stroke Path

Paint along a path on the active layer with a painting or retouching tool, using that tool's current brush and options (Paths panel > Stroke Path). Give a path from the Paths panel or points for a temporary one. Set the brush first with set_tool_options. Clone Stamp and Healing Brush need cloneSource

ParameterTypeDescription
tool *stringThe tool to paint with
cloneSourceobjectClone Stamp and Healing Brush: where to sample from, as Alt-clicking does
closedbooleanWith points: close the temporary path. Default false
pathstringName of a path in the Paths panel
pointsarrayInstead of path: corners of a temporary path, [[x, y], ...] in pixels. It is removed afterwards
simulatePressurebooleanTaper the stroke as if drawn with a pressure-sensitive pen. Default false

fill_path Fill Path

Fill the area inside a path on the active layer with a colour (Paths panel > Fill Path), with blend mode, opacity, feather and anti-aliasing. Give a path from the Paths panel or points for a temporary one

ParameterTypeDescription
antiAliasbooleanDefault true
blendModestringDefault normal
colorstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Default the foreground colour
feathernumberPixels. Default 0
opacitynumberPercent. Default 100
pathstringName of a path in the Paths panel
pointsarrayInstead of path: corners of a temporary path, [[x, y], ...] in pixels. It is removed afterwards
preserveTransparencybooleanDefault false

fill_at_point Fill At Point

Fill (Paint Bucket tool) or erase (Magic Eraser tool) the area of similar colour around a point on the active layer, within the selection if there is one. Erasing on the Background layer turns it into an ordinary layer, as the Magic Eraser does

ParameterTypeDescription
action *string
x *numberPixels from the left
y *numberPixels from the top
antiAliasbooleanSmooth the edge. Default true
blendModestringFill only. Default normal
colorstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Fill only. Default the foreground colour
contiguousbooleanOnly connected pixels. Default true
opacitynumberPercent. Default 100
sampleAllLayersbooleanJudge colours from all visible layers. Default false
toleranceintegerHow different a colour may be and still be included. Default 32

set_tool_options Set Tool Options

Choose the active tool and set its options bar: a brush preset (Brushes panel or the Brush Preset picker), size, hardness, opacity, flow, blend mode, the tablet pressure buttons for size and opacity, Smoothing and its options (Pulled String Mode, Stroke Catch-up, Catch-up on Stroke End, Adjust for Zoom), the Mixer Brush's Wet, Mix and Sample All Layers, Tolerance and Contiguous (Color Replacement, Paint Bucket, Magic Eraser), and the painting cursor style (Preferences > Cursors). The Mixer Brush, Spot Healing Brush and Red Eye tools can be made active here; painting with them stays on the canv…

ParameterTypeDescription
adjustForZoombooleanSmoothing options: Adjust for Zoom
catchUpOnStrokeEndbooleanSmoothing options: Catch-up on Stroke End
contiguousbooleanContiguous (Paint Bucket, Magic Eraser)
flowintegerTool flow, percent
hardnessnumberBrush hardness, percent
mixnumberMixer Brush: Mix, percent
modestringBlend mode (options bar Mode) of a painting tool, the Paint Bucket or the Magic Eraser
opacityintegerTool opacity, percent
paintingCursorsstringHow painting cursors look
presetstringBrush preset name, as the Brushes panel lists it
pressureControlsOpacitybooleanOptions bar button: pen pressure controls opacity
pressureControlsSizebooleanOptions bar button: pen pressure controls size, overriding the Brush Settings panel
pulledStringModebooleanSmoothing options: Pulled String Mode
sampleAllLayersbooleanSample All Layers (Mixer Brush and other tools that have it)
sizenumberBrush diameter in pixels
smoothingnumberStroke Smoothing, percent (options bar)
strokeCatchUpbooleanSmoothing options: Stroke Catch-up
tolerancenumberTolerance: percent (1-100) for the Color Replacement tool, 0-255 for the Paint Bucket and Magic Eraser
toolstringTool to make active. Default the current tool
wetnumberMixer Brush: Wet, percent

manage_brushes Manage Brushes

Brush presets and files (Brushes panel and its menu): load a brush file (.abr) as the current tool's brush (Import Brushes), save the current tool's brush to a file (Export Selected Brushes), define a preset from the selection, or the whole image when nothing is selected (Edit > Define Brush Preset), save the current brush and its settings as a new preset (New Brush Preset), rename or delete a preset, or restore the default brushes (Reset Brushes), replacing the current set or appending to it

ParameterTypeDescription
action *string
appendbooleanReset: add the default brushes to the current ones instead of replacing them. Default false
filePathstringImport or export: absolute path to a .abr file
namestringDefine and new_preset: the new preset's name. Rename: the new name
presetstringRename and delete: the preset's name, as the Brushes panel lists it

retouch_selection Retouch Selection

Repair or move the selected area on the active pixel layer by an offset: patch it from nearby pixels (Patch tool, Normal or Content-Aware), or move or extend it and fill the gap (Content-Aware Move tool). Needs a selection; dx and dy are the drag in pixels

ParameterTypeDescription
dx *numberHorizontal offset in pixels, positive to the right
dy *numberVertical offset in pixels, positive downward
method *string
colorintegerHow much colour blending, 0 to 10. Default 5
moveModestringContent-Aware Move: move the content, or extend (duplicate) it. Default move
patchFromstringPatch: source repairs the selection with the pixels at the offset; destination copies the selection to the offset. Default source
patchModestringPatch: how the patch blends. Default content_aware
sampleAllLayersbooleanSample all visible layers. Default false
structureintegerHow closely the result keeps existing image patterns, 1 (loose) to 7 (strict). Default 5 for patch, 4 for move
transparentbooleanPatch: blend the sampled texture transparently. Default false

set_brush_settings Set Brush Settings

Set the current tool's brush in the Brush Settings panel (Window > Brush Settings): Brush Tip Shape (size, hardness, angle, roundness, spacing, flip), Shape Dynamics, Scattering, Texture, Dual Brush, Color Dynamics, Transfer and Brush Pose, each section's on/off switch, the jitters and their Control (fade, pen pressure, tilt, stylus wheel, direction, rotation), and the Noise, Wet Edges, Build-up, Smoothing and Protect Texture checkboxes; clearControls first turns every dynamics option off (Clear Brush Controls). Only the settings given change; one the tool lacks is an error. stroke_path paints…

set_clone_source_options Set Clone Source Options

Use the Clone Source panel (Window > Clone Source) and its menu: choose which of the five clone sources the Clone Stamp and Healing Brush use, reset the active source's scale and rotation (Reset Transform), and toggle the overlay options Show Overlay, Auto Hide, Clip to Brush Tip and Invert. The overlay toggles flip the current state, which Photoshop does not report to scripts. Set a source's sample point with stroke_path cloneSource; show the panel with show_photoshop_panels

ParameterTypeDescription
resetTransformbooleanReset the active source's offset scale and rotation (Reset Transform)
sourceintegerClone source to make active, 1-5
togglearrayOverlay options to toggle, in order

create_text_layer Create Text Layer

Add a type layer: point type at a position, or paragraph type in a box (width and height), with its font, size, colour and formatting. Line breaks in text start new paragraphs

ParameterTypeDescription
text *string
x *numberPixels from the left: the baseline start for point type, the box's left edge for paragraph type
y *numberPixels from the top
baselineShiftnumberPixels
capitalizationstring
colorstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
fauxBoldboolean
fauxItalicboolean
fontstringPostScript font name (list_fonts), e.g. "MyriadPro-Regular"
heightnumberParagraph type: box height in pixels
horizontalScalenumberPercent
justificationstring
leadingnumberPixels; turns auto leading off
namestring
sizenumberPixels
strikethroughboolean
trackingnumberThousandths of an em
underlineboolean
verticalScalenumberPercent
widthnumberParagraph type: box width in pixels

set_text Set Text

Change a type layer's text and/or formatting (applied to the whole layer), its position, and its warp (Type > Warp Text)

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
baselineShiftnumberPixels
capitalizationstring
colorstring"#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
fauxBoldboolean
fauxItalicboolean
fontstringPostScript font name (list_fonts), e.g. "MyriadPro-Regular"
horizontalScalenumberPercent
justificationstring
leadingnumberPixels; turns auto leading off
sizenumberPixels
strikethroughboolean
textstring
trackingnumberThousandths of an em
underlineboolean
verticalScalenumberPercent
warpstring
warpBendnumber
warpHorizontalDistortionnumber
warpVerticalDistortionnumber
xnumber
ynumber

list_fonts List Fonts

List installed fonts with their PostScript name, family and style, filtered by a search string

ParameterTypeDescription
limitinteger
querystring

set_type_options Set Type Options

Set Character and Paragraph panel options on type layers: anti-aliasing, text and warp orientation (vertical type), kerning, language, No Break, OpenType ligatures and oldstyle figures, the paragraph type box size, indents, paragraph spacing, hyphenation, justification spacing, hanging punctuation and the composer

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
antiAliasstringAnti-aliasing method (Type > Anti-Alias)
boxHeightnumberParagraph type: bounding box height in pixels
boxWidthnumberParagraph type: bounding box width in pixels
composerstringAdobe Every-line or Single-line Composer (Paragraph panel menu)
discretionaryLigaturesbooleanOpenType Discretionary Ligatures (Character panel)
firstLineIndentnumberIndent first line in pixels (Paragraph panel)
hangingPunctuationbooleanRoman Hanging Punctuation (Paragraph panel menu)
hyphenatebooleanHyphenate (Paragraph panel)
hyphenationobjectHyphenation dialog (Paragraph panel menu > Hyphenation)
justificationSpacingobjectJustification dialog (Paragraph panel menu > Justification)
kerningstringKerning (Character panel): metrics, optical or manual
languagestringLanguage for hyphenation and spelling (Character panel)
leftIndentnumberIndent left margin in pixels (Paragraph panel)
ligaturesbooleanOpenType Standard Ligatures (Character panel)
noBreakbooleanNo Break: keep words from breaking at line ends (Character panel menu)
oldStylebooleanOpenType Oldstyle figures (Character panel)
orientationstringText orientation (Type > Orientation): vertical gives vertical type
rightIndentnumberIndent right margin in pixels (Paragraph panel)
spaceAfternumberAdd space after paragraph, pixels (Paragraph panel)
spaceBeforenumberAdd space before paragraph, pixels (Paragraph panel)
warpOrientationstringOrientation of the warp (Warp Text dialog)

convert_type_layer Convert Type Layer

Convert type layers (Type menu): to paragraph or point type, to a shape layer (Convert to Shape), to a work path (Create Work Path, which replaces the current work path), or to a selection shaped like the text, as the Type Mask tools make

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
to *stringWhat to convert the type into
combinestringselection: how the text outline combines with the current selection. Default replace
removeLayerbooleanselection: delete the type layers afterwards, leaving only the selection (as the Type Mask tools do). Default false

find_replace_layer_text Find Replace Layer Text

Find and replace text in type layers (Edit > Find and Replace Text), keeping each layer's formatting. Searches every visible, unlocked type layer, or one layer. Line breaks in the replacement start new paragraphs

ParameterTypeDescription
find *stringText to find
replace *stringReplacement text; empty deletes the matches
caseSensitivebooleanMatch case. Default false
ignoreAccentsbooleanIgnore accents. Default false
targetobjectSearch only this type layer instead of all of them (one layer)
wholeWordbooleanWhole words only. Default false

run_type_menu_command Run Type Menu Command

Run a Type menu command: Update All Text Layers (also updates legacy and Asian text layers for vector output), Replace All Missing Fonts, Save Default Type Styles or Load Default Type Styles

ParameterTypeDescription
command *stringThe Type menu command

fill_type_with_image Fill Type With Image

Fill type with an image: move an image layer directly above a type layer and clip it to the type (Layer > Create Clipping Mask), so the image shows only through the letters

ParameterTypeDescription
image *objectThe image layer to show through the type (one pixel or smart object layer)
target *objectThe type layer (one layer)

toggle_type_panels Toggle Type Panels

Show or hide a type panel (Window > Character, Paragraph, Character Styles or Paragraph Styles). Each call switches the panel between shown and hidden

ParameterTypeDescription
panel *stringThe panel to show or hide

draw_vector_shape Draw Vector Shape

Draw with the shape and pen tools: rectangles (with rounded corners), ellipses, triangles, polygons, stars, lines, custom shape presets and pen points, combined with path operations. Mode shape makes a shape layer filled with a colour; path adds a path to the Paths panel; pixels fills the shape on the active layer

ParameterTypeDescription
components *arrayThe shape's components, drawn in order; each one's operation combines it with those before it
antiAliasbooleanpixels: smooth the edges. Default true
colorstringFill colour for shape and pixels modes. Default: the foreground colour
modestringTool mode: shape layer (default), path, or pixels
namestringName of the new shape layer, or of the new path (default "Path", numbered if taken)
opacitynumberpixels: fill opacity percent. Default 100

list_paths List Paths

List the Paths panel: each path's index, name and kind (saved path, work path, clipping path, vector or type mask) and its number of components; optionally every component's anchor points and direction handles, in pixels

ParameterTypeDescription
pathstringPath name, as in the Paths panel (list_paths)
pathIndexintegerPath index from list_paths, instead of its name
pointsbooleanInclude each component's operation, closed state and anchor points. Default false

manage_paths Manage Paths

Paths panel commands: rename, duplicate or delete a path; select or deselect it (Path Selection); load it as a selection (Make Selection); make a work path from the selection (Make Work Path); make it the clipping path; fill or stroke it on the active layer; save it as a custom shape preset (Edit > Define Custom Shape); or show/hide the Paths panel

ParameterTypeDescription
action *stringThe command
antiAliasbooleanmake_selection and fill: anti-aliased edges. Default true
colorstringfill: colour. Default: the foreground colour
combinestringmake_selection: how it combines with the current selection. Default replace
feathernumbermake_selection and fill: feather radius in pixels. Default 0
flatnessnumbermake_clipping_path: flatness in device pixels. Default: the printer's
newNamestringrename: the new name; duplicate: the copy's name; define_custom_shape: the preset name
opacitynumberfill: opacity percent. Default 100
pathstringPath name, as in the Paths panel (list_paths)
pathIndexintegerPath index from list_paths, instead of its name
preserveTransparencybooleanfill: leave transparent pixels transparent. Default false
simulatePressurebooleanstroke: taper the stroke as pen pressure would. Default false
tolerancenumbermake_work_path: tolerance in pixels (lower follows the selection more closely). Default 2
toolstringstroke: the painting tool, with its current settings. Default brush

edit_path_points Edit Path Points

Edit a path's anchor points, as the Add Anchor Point, Delete Anchor Point, Convert Point and Direct Selection tools do: add a point (splitting a segment in half without changing its shape, or at a position), delete one, move a point or its direction handles, convert it between smooth and corner, or change a component's path operation. The path is rebuilt under its name; a work path becomes a saved path

ParameterTypeDescription
operation *stringThe edit
componentintegerComponent (subpath) index from list_paths. Default 0
handleInobjectDirection point of the arriving segment, pixels
handleOutobjectDirection point of the leaving segment, pixels
kindstringconvert_point: smooth computes handles from the neighbouring points unless handles are given; corner retracts the handles unless handles are given
pathstringPath name, as in the Paths panel (list_paths)
pathIndexintegerPath index from list_paths, instead of its name
pathOperationstringset_operation: combine, subtract, intersect or exclude
pointintegerPoint index in the component. add_point: without x and y, splits the segment after this point; with them, inserts the new point at this index
smoothbooleanadd_point with x and y: make a smooth point. Default false
xnumberadd_point and move_point: anchor position, pixels from the left
ynumberadd_point and move_point: anchor position, pixels from the top

export_image Export Image

Export the document as one PNG, PNG-8, JPEG or GIF file (Save for Web), optionally resized. Works on a temporary copy, so the document is unchanged

ParameterTypeDescription
outputFile *stringAbsolute path; the extension must match the format
blurnumberJPEG: blur before compressing, 0-2 pixels, to make the file smaller
colorReductionstringPNG-8 and GIF. Default selective
colorsintegerPNG-8 and GIF colours. Default 256
ditherstringPNG-8 and GIF. Default diffusion
formatstringpng (PNG-24), png8, jpeg or gif. Default png
heightnumberResize the export to this height in pixels (width follows)
includeProfilebooleanEmbed the colour profile. Default false
interlacedbooleanDefault false
lossyintegerGIF: lossy compression, 0-100
qualityintegerJPEG quality, 0-100. Default 80
transparencybooleanKeep transparency (PNG, GIF). Default true
webSnapintegerPNG-8 and GIF: shift colours to web-safe ones within this tolerance, percent
widthnumberResize the export to this width in pixels (height follows)

export_layers Export Layers

Export each top-level layer or group (or the ones chosen) to its own file, named <prefix><layer name>.<ext>, by showing one at a time on a temporary copy (File > Export > Layers to Files)

ParameterTypeDescription
outputFolder *stringAbsolute folder path
blurnumberJPEG: blur before compressing, 0-2 pixels, to make the file smaller
colorReductionstringPNG-8 and GIF. Default selective
colorsintegerPNG-8 and GIF colours. Default 256
ditherstringPNG-8 and GIF. Default diffusion
formatstringpng (PNG-24), png8, jpeg or gif. Default png
heightnumberResize the export to this height in pixels (width follows)
idsarrayTop-level layer or group ids. Default all visible ones
includeProfilebooleanEmbed the colour profile. Default false
interlacedbooleanDefault false
lossyintegerGIF: lossy compression, 0-100
prefixstringFile name prefix
qualityintegerJPEG quality, 0-100. Default 80
transparencybooleanKeep transparency (PNG, GIF). Default true
trimbooleanTrim each export to the layer's pixels. Default false
webSnapintegerPNG-8 and GIF: shift colours to web-safe ones within this tolerance, percent
widthnumberResize the export to this width in pixels (height follows)

quick_export Quick Export

Quick Export the whole document, or chosen layers, groups or artboards, as PNG, JPG or GIF into a folder in one step (File > Export > Quick Export As; Layers panel > Quick Export As). Files are named after the document or each layer

ParameterTypeDescription
outputFolder *stringAbsolute folder path
fileTypestringDefault png
includeMetadatabooleanInclude copyright and contact metadata. Default false
layersobjectExport these layers, groups or artboards, each to its own file. Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default: the whole document
qualityintegerJPG quality, 1-100. Default 90
sRGBbooleanConvert to sRGB. Default true

export_layer_comps Export Layer Comps

Export layer comps, each to its own file (File > Export > Layer Comps to Files) or as the pages of one PDF (Layer Comps to PDF). The document is returned to its state before the export

ParameterTypeDescription
advanceSecondsnumberpdf: Slideshow: advance every this many seconds
compsarrayLayer comp names. Default all
fileTypestringfiles: psd, tiff, jpeg (default), png or pdf
includeFilenamebooleanpdf: Print each file's name on its page
loopbooleanpdf: Slideshow: loop after the last page
magnificationstringpdf: Slideshow: page view
outputFilestringpdf: absolute path ending in .pdf
outputFolderstringfiles: absolute folder path
prefixstringfiles: file name prefix; each file is <prefix><comp name>
qualityintegerJPEG quality, 0-12. Default 10
slideshowbooleanpdf: A full-screen slideshow instead of a multi-page document. Default false
tostringDefault files
transitionstringpdf: Slideshow: transition between pages

export_paths_to_illustrator Export Paths To Illustrator

Export paths as an Adobe Illustrator file (File > Export > Paths to Illustrator): all paths, one named path, or just the document bounds

ParameterTypeDescription
outputFile *stringAbsolute path ending in .ai
pathNamestringnamed: the path's name in the Paths panel
pathsstringDefault all

make_pdf_presentation Make PDF Presentation

Combine image files into one multi-page PDF or a full-screen PDF slideshow (File > Automate > PDF Presentation), in the order given (a file may repeat), optionally adding the open documents, with slideshow timing, looping and transitions, file names on the pages, and Photoshop PDF save options

ParameterTypeDescription
outputFile *stringAbsolute path ending in .pdf
advanceSecondsnumberSlideshow: advance every this many seconds
filesarrayAbsolute paths of the source files, in page order
includeFilenamebooleanPrint each file's name on its page
includeOpenFilesbooleanAdd the open documents that have been saved (Add Open Files), after files. Default false
loopbooleanSlideshow: loop after the last page
magnificationstringSlideshow: page view
pdfOptionsobjectPhotoshop PDF options, as for save_document's PDF options
pdfPresetstringAdobe PDF preset name, e.g. "[Smallest File Size]"
pdfStandardstringPDF/X standard
slideshowbooleanA full-screen slideshow instead of a multi-page document. Default false
transitionstringSlideshow: transition between pages

generate_image_assets Generate Image Assets

Set up Generator image assets (File > Generate > Image Assets): name layers with asset specs such as "icon.png", "200% hero@2x.png24" or "50x50 thumb.jpg80%" so Generator writes them to a folder next to the PSD, set the document-wide defaults layer ("default 200% @2x/"), and turn Image Assets on or off for the document

ParameterTypeDescription
assetsarrayLayers to name as assets
defaultsstringDocument-wide defaults written as an empty layer named "default <defaults>", e.g. "200% @2x/, 50% small/"
togglebooleanSwitch Image Assets generation on or off for the document (it is a toggle). Default false

list_history List History

List the History panel's states and snapshots, and which one is current

undo Undo

Step back (undo) or forward (redo) through the history, or go to a state by index. Undone steps stay available until something new is done

ParameterTypeDescription
stepsintegerPositive to undo, negative to redo. Default 1
toIndexintegerGo to this history state instead

make_snapshot Make Snapshot

Save the current state as a History snapshot, so it can be returned to later

ParameterTypeDescription
namestring

edit_history Edit History

Change the history: revert to the last save (File > Revert), delete a state or snapshot, clear the history, make a new document from a state, set the history brush source or pick the History Brush tool (History panel), or purge every document's history (Edit > Purge > Histories). Clearing and purging cannot be undone

ParameterTypeDescription
operation *string
indexintegerdelete_state, set_brush_source: the state or snapshot (index from list_history). new_document: the state to copy. Default the current state

set_history_options Set History Options

Read or set the history preferences: History Options (Automatically Create First Snapshot, Allow Non-Linear History, number of history states) and the History Log (Preferences > History & Content Credentials: on or off, saved to metadata, a text file or both, and how much it records)

ParameterTypeDescription
autoFirstSnapshotbooleanAutomatically Create First Snapshot
logbooleanTurn the History Log on or off
logDetailstringEdit Log Items: sessions only, concise or detailed
logFilestringAbsolute path of the log text file, for logTo file or both
logTostringWhere the log is saved
nonLinearbooleanAllow Non-Linear History
statesintegerHistory states kept per document

get_timeline Get Timeline

Describe the document's timeline (Timeline panel): frame rate, playhead time, duration and work area when Photoshop reports them, the frame count in frame animation mode, and the video layers

create_timeline Create Timeline

Create a video timeline or a frame animation for the document, or convert between the two (Timeline panel: Create Video Timeline, Create Frame Animation, Convert to Frame Animation, Convert to Video Timeline)

ParameterTypeDescription
mode *stringvideo (new video timeline), frames (new frame animation), convert_to_frames or convert_to_video
frameRatenumberFrame rate for a new or converted video timeline, in frames per second

set_timeline Set Timeline

Set the timeline: show or hide the Timeline panel, set the frame rate (Set Timeline Frame Rate), move the playhead to a time or Go To a frame or the work area, and choose the Layers panel's Animation Options

ParameterTypeDescription
animationOptionsstringLayers panel Animation Options: automatic, always_show or always_hide the unified layer buttons
frameRatenumberTimeline frame rate in frames per second
goTostringMove the playhead instead: first or last frame, one frame or one second forward or back, or the work area start or end
panelstringShow or hide the Timeline panel (Window > Timeline)
timeobjectMove the playhead (current-time indicator) to this time

run_timeline_command Run Timeline Command

Run a video timeline command on the selected clips, keyframes or video layer at the playhead (Timeline panel menu: Move & Trim, Split at Playhead, Work Area, Keyframes, Convert Frames, Enable Onion Skins, Show; Layer > Video Layers: Insert, Delete, Duplicate, Reload or Restore Frame, Hide Altered Video). Toggles switch the setting each time

ParameterTypeDescription
command *stringThe command to run
targetobjectClips (layers) to select first. Default: the current selection

edit_frame_animation Edit Frame Animation

Edit a frame animation (Timeline panel in frame mode): new, delete, copy, paste, reverse or tween frames, select a frame, make frames from layers, flatten frames into layers, match a layer across frames, delete the animation, and the New Layers options. Tween and Paste Frames use the dialog's last settings

ParameterTypeDescription
command *stringThe command to run on the selected frames
frameintegerFor select_frame: the frame number, 1 for the first
matchPositionbooleanFor match_layer: match the active layer's position. Default true
matchStylebooleanFor match_layer: match its layer style. Default true
matchVisibilitybooleanFor match_layer: match its visibility. Default true

add_video_layer Add Video Layer

Add a blank video layer above the active layer, for frame-by-frame painting (Layer > Video Layers > New Blank Video Layer)

ParameterTypeDescription
namestringName for the new layer

import_video_frames Import Video Frames

Import a video file's frames as layers of a new document, optionally as a frame animation (File > Import > Video Frames to Layers)

ParameterTypeDescription
file *stringAbsolute path of the video file
endTimeobjectImport up to this time. Default the end
frameRatenumberThe video's frame rate, which the frames in startTime and endTime count in. Default 30
frameSkipintegerKeep every Nth frame (Limit To Every N Frames)
makeAnimationbooleanMake a frame animation from the layers. Default false
startTimeobjectImport from this time. Default the start

set_clip_timing Set Clip Timing

Move the in or out point of clips (layer duration bars) in the video timeline, or set their duration

ParameterTypeDescription
target *objectWhich layers to act on. Give ids (from list_layers or a create tool), names, or active: true
durationobjectSet each clip's duration instead, measured from its in point
moveInobjectMove each clip's in point by this offset (negative is earlier)
moveOutobjectMove each clip's out point by this offset (negative is earlier)

add_video_transition Add Video Transition

Add a transition (Fade, Cross Fade, Fade With Black or Fade With White) where two adjacent clips meet in the video timeline (Timeline panel transitions)

ParameterTypeDescription
target *objectThe two adjacent clips (layers) to join
durationobjectTransition length. Default 1 second
typestringfade, cross_fade, fade_black or fade_white. Default cross_fade

render_video Render Video

Render the timeline to a video file through Adobe Media Encoder (File > Export > Render Video), at the document size

ParameterTypeDescription
name *stringFile name, ending in .mp4 for h264 or .mov for quicktime
outputFolder *stringAbsolute folder to render into
formatstringh264 (MP4) or quicktime (MOV). Default h264
frameRatenumberOutput frame rate. Default the timeline's
presetstringMedia Encoder preset file name, as listed in the Render Video dialog. Default "1_High Quality.epr" for h264; required for quicktime

list_action_sets List Action Sets

List the Actions panel's action sets and the actions in each, optionally with each action's recorded steps (Window > Actions)

ParameterTypeDescription
stepsbooleanInclude each action's step names. Default false

edit_actions Edit Actions

Change the Actions panel: create an empty set, delete a set, an action or one of its steps, clear every set, reset to Default Actions, load an .atn file or one of Photoshop's bundled sets, or save a set as an .atn file (Actions panel menu)

ParameterTypeDescription
operation *stringcreate_set (New Set), delete (Delete), clear_all (Clear All Actions), reset (Reset Actions: clear, then load Default Actions), load (Load Actions), save (Save Actions)
actionstringdelete: the action to delete (or whose step to delete) inside set
filePathstringload or save: absolute path of an .atn file
presetstringload: a set bundled in Photoshop's Presets/Actions folder, e.g. "Frames", "Image Effects", "Production"
setstringSet name: the new set for create_set, the set to delete, save, or that holds action
stepintegerdelete: the step number (1 = first) inside action

set_action_options Set Action Options

Set how actions play back (Actions panel menu > Playback Options: accelerated, step by step, or pause between steps), and toggle Button Mode or Allow Tool Recording

ParameterTypeDescription
pauseSecondsintegerSeconds between steps, for playback pause. Default 1
playbackstringPlayback Options performance
toggleButtonModebooleanSwitch Button Mode on or off (it toggles; the panel shows the current state)
toggleToolRecordingbooleanSwitch Allow Tool Recording on or off (it toggles)

run_action_batch Run Action Batch

Play an action on every file in a folder, a list of files, or the open documents, and leave, save over, or save them to a folder (File > Automate > Batch). Long batches can outlast the script timeout (PHOTOSHOP_SCRIPT_TIMEOUT_MS)

ParameterTypeDescription
action *stringAction name, as in the Actions panel (list_action_sets)
set *stringAction set name
compatibilityobjectFile name compatibility. Default: the current platform only
destinationstringnone: leave files open, save_and_close: save over the source, folder: save into destinationFolder. Default none
destinationFolderstringAbsolute folder path, for destination folder
errorLogstringAbsolute path of a text file to log errors to (Log Errors To File). Omit to stop for errors
extensionsarrayOnly files with these extensions from sourceFolder, e.g. ["jpg", "png"]
fileNamingarrayFile Naming for destination folder: up to 6 parts joined in order. Default ["document_name", "extension_lower"]
filesarraySource: these absolute file paths
includeSubfoldersbooleanInclude All Subfolders of sourceFolder. Default false
openDocumentsbooleanSource: the open documents (Opened Files); each must have been saved
overrideOpenbooleanOverride Action "Open" Commands: the action's own Open steps open each source file instead. Default false
overrideSaveAsbooleanOverride Action "Save As" Commands: the action's Save As steps save into the destination instead of their recorded place. Default false
sourceFolderstringSource: every file in this absolute folder path
startingSerialintegerStarting serial number for serial parts. Default 1
suppressOpenDialogsbooleanSuppress File Open Options Dialogs (camera raw and similar). Default true
suppressProfileWarningsbooleanSuppress Color Profile Warnings. Default true

create_droplet Create Droplet

Save an action as a droplet: an application that plays the action on files dropped onto it, with Batch's open, save and naming options (File > Automate > Create Droplet)

ParameterTypeDescription
action *stringAction name, as in the Actions panel (list_action_sets)
filePath *stringAbsolute path of the droplet to create (an .app on macOS, an .exe on Windows)
set *stringAction set name
compatibilityobjectFile name compatibility. Default: the current platform only
destinationstringnone: leave files open, save_and_close: save over the source, folder: save into destinationFolder. Default none
destinationFolderstringAbsolute folder path, for destination folder
errorLogstringAbsolute path of a text file to log errors to (Log Errors To File). Omit to stop for errors
fileNamingarrayFile Naming for destination folder: up to 6 parts joined in order. Default ["document_name", "extension_lower"]
overrideOpenbooleanOverride Action "Open" Commands: the action's own Open steps open each source file instead. Default false
overrideSaveAsbooleanOverride Action "Save As" Commands: the action's Save As steps save into the destination instead of their recorded place. Default false
startingSerialintegerStarting serial number for serial parts. Default 1
suppressOpenDialogsbooleanSuppress File Open Options Dialogs (camera raw and similar). Default true
suppressProfileWarningsbooleanSuppress Color Profile Warnings. Default true

run_automate_command Run Automate Command

Run a File > Automate or File > Scripts command on the active document without its dialog: crop_and_straighten (Crop and Straighten Photos: each scanned photo into its own document), fit_image (Fit Image: resize to fit a box), conditional_mode_change (Conditional Mode Change), lens_correction (Automate > Lens Correction's automatic profile correction), delete_empty_layers (Delete All Empty Layers), flatten_layer_effects (Flatten All Layer Effects), flatten_masks (Flatten All Masks)

ParameterTypeDescription
command *string
autoScalebooleanlens_correction: scale to hide blank edges. Default true
chromaticAberrationbooleanlens_correction: correct chromatic aberration. Default false
distortionbooleanlens_correction: correct geometric distortion. Default true
dontEnlargebooleanfit_image: leave images already smaller than the box. Default false
edgestringlens_correction: fill for edges left blank. Default transparency
flattenbooleanconditional_mode_change: flatten while converting. Default false
heightnumberfit_image: box height in pixels
sourceModesarrayconditional_mode_change: convert only from these modes. Default all
targetModestringconditional_mode_change: the mode to convert to
vignettebooleanlens_correction: remove vignetting. Default false
widthnumberfit_image: box width in pixels

combine_images Combine Images

Combine image files into a new document with one of Photoshop's multi-file commands, without its dialog: stack (File > Scripts > Load Files into Stack), photomerge (File > Automate > Photomerge panorama), hdr (File > Automate > Merge to HDR Pro, with its last-used settings) or statistics (File > Scripts > Statistics stack mode). Large merges can outlast the script timeout

ParameterTypeDescription
files *arrayAbsolute paths of two or more images
method *string
alignbooleanstack, hdr, statistics: auto-align the layers. Default false (hdr: true)
blendbooleanphotomerge: Blend Images Together. Default true
distortionCorrectionbooleanphotomerge: Geometric Distortion Correction. Default false
fillTransparentbooleanphotomerge: Content Aware Fill Transparent Areas. Default false
layoutstringphotomerge: Auto (default), Perspective, Cylindrical, Spherical, Collage or Reposition
smartObjectbooleanstack: convert the stack into a smart object. Default false
statisticstringstatistics: the stack mode. Default median
vignetteRemovalbooleanphotomerge: Vignette Removal. Default false

manage_script_events Manage Script Events

List, add or remove the scripts and actions Photoshop runs when an event happens, and turn them on or off (File > Scripts > Script Events Manager)

ParameterTypeDescription
operation *string
eventstringadd: the event, as a four-character code or event id, e.g. "Opn " (Open Document), "save", "Mk " (New Document)
eventClassstringadd: the class the event applies to, e.g. "Dcmn" to fire Make only for documents
indexintegerremove: the notifier's index from list
scriptFilestringadd: absolute path of the .jsx or .js script to run

manage_data_sets Manage Data Sets

Work with variable data sets on the active document: import them from a text file (File > Import > Variable Data Sets), apply one (Image > Apply Data Set), or save a PSD per data set into a folder (File > Export > Data Sets as Files). Variables themselves are defined in Image > Variables > Define

ParameterTypeDescription
operation *string
filePathstringimport: absolute path of the comma- or tab-delimited text file
firstColumnNamesbooleanimport: use the first column as the data set names. Default false
folderstringexport: absolute folder path
namestringapply: the data set name
namesarrayexport: the data sets to save, each as <name>.psd
replacebooleanimport: replace the existing data sets. Default true

get_artboards Get Artboards

List the active document's artboards with id, name, position and size in pixels, layer count and background (Artboard properties in the Properties panel)

create_artboard Create Artboard

Create an artboard: new at a position and size (Layer > New > Artboard), from layers (Artboard from Layers), from a group (Artboard from Group), or a new document of type Artboard (File > New). The steps in the document form one history state

ParameterTypeDescription
backgroundstringArtboard background: "white", "black", "transparent", or a colour ("#RRGGBB", "rgb(r,g,b)", ...)
fromstringDefault new
heightnumbernew, document: height in pixels
namestringArtboard (or document) name
resolutionnumberdocument: pixels per inch. Default 72
targetobjectlayers: the layers to put on the artboard. group: the group to convert
widthnumbernew, document: width in pixels
xnumbernew: left edge in pixels. Default to the right of the existing artboards
ynumbernew: top edge in pixels. Default 0

edit_artboards Edit Artboards

Change artboards: set name, position, size, background colour and auto-nesting (Properties panel), duplicate one, ungroup them back to layers (Layer > Ungroup Artboards), clear their guides (View > Guides > Clear Selected Artboard Guides), add guides from a shape (New Artboard Guides From Shape), or pick the Artboard or Frame tool

ParameterTypeDescription
operation *string
autoNestbooleanset: let layers moved onto or off the artboard nest into or out of it automatically (false prevents auto-nesting)
backgroundstringArtboard background: "white", "black", "transparent", or a colour ("#RRGGBB", "rgb(r,g,b)", ...)
heightnumberset: height in pixels
namestringset, duplicate: new name
targetobjectThe artboards (ids from get_artboards); for guides_from_shape, the shape layer
toolstringselect_tool: the Artboard tool or the Frame tool
widthnumberset: width in pixels
xnumberset, duplicate: left edge in pixels
ynumberset, duplicate: top edge in pixels

create_frame Create Frame

Put layers inside a frame (Add Frame to Layers) or turn a group into a frame (Add Frame To Layer Group); the frame clips its contents to its shape

ParameterTypeDescription
target *objectlayers: the layers to frame. group: the group to convert
fromstringDefault layers

export_artboards Export Artboards

Save each artboard as its own file, cropped to the artboard with its background, as PNG, JPEG, PSD, TIFF or PDF (File > Export > Artboards to Files), or all of them as one multi-page PDF (Artboards to PDF). The document is not changed

ParameterTypeDescription
folder *stringAbsolute folder path
formatstringDefault png
includeBackgroundbooleanFill with the artboard background colour (unless it is transparent). Default true
pdfNamestringsinglePdf: the PDF file name. Default the document name
prefixstringText before each artboard name in the file names
singlePdfbooleanpdf: one multi-page PDF instead of one PDF per artboard. Default false
targetobjectOnly these artboards. Default all

manage_recent_files Manage Recent Files

List the files in File > Open Recent, open one of them by its index, or clear the list (Clear Recent File List)

ParameterTypeDescription
actionstringDefault list
indexintegeropen: the file's index in the list

close_documents Close Documents

Close every open document (File > Close All). Unsaved changes are discarded unless save is true; with save, documents that have never been saved are refused before anything closes

ParameterTypeDescription
savebooleanSave each document before closing it. Default false

go_to_bridge Go To Bridge

Open Adobe Bridge (File > Browse in Bridge), or close the active document and switch to Bridge (File > Close and Go to Bridge). Needs Bridge installed

ParameterTypeDescription
closeDocumentbooleanClose the active document first. It must have no unsaved changes. Default false

get_document_metadata Get Document Metadata

Read the active document's File Info metadata: title, author, description, keywords, copyright, IPTC origin, categories, the camera data (Exif), and optionally the raw XMP packet

ParameterTypeDescription
includeXmpbooleanInclude the raw XMP packet. Default false

set_document_metadata Set Document Metadata

Set the active document's File Info metadata: title, author, description, keywords, copyright, IPTC origin and categories, or replace its whole XMP packet. Only the fields given change. Camera data (Exif) is read-only

ParameterTypeDescription
authorstringCreator (author) name
authorPositionstringCreator's job title
captionstringCaption (description)
captionWriterstringDescription writer
categorystringLegacy IPTC category (up to 3 characters)
citystringCity
copyrightNoticestringCopyright notice
copyrightedstringCopyright status
countrystringCountry
creationDatestringDate created, YYYYMMDD
creditstringCredit line
headlinestringHeadline
instructionsstringSpecial instructions
jobNamestringJob name
keywordsarrayKeywords (replaces the list)
ownerUrlstringCopyright info URL
provinceStatestringState or province
sourcestringSource
supplementalCategoriesarraySupplemental categories (replaces the list)
titlestringDocument title
transmissionReferencestringJob identifier (transmission reference)
urgencystringUrgency: 1 (high) to 8 (low), 5 normal, or none
xmpstringA complete XMP packet (<x:xmpmeta ...>) that replaces the document's metadata. Applied before the fields above

manage_document_notes Manage Document Notes

Work with notes (non-printing annotations): import the notes from a PDF or FDF file into the active document (File > Import > Notes), delete all of its notes (Note tool: Clear All), choose the Note tool, or show or hide the Notes panel (Window > Notes). Writing a note's text is done by hand with the Note tool

ParameterTypeDescription
action *stringWhat to do
filestringimport: absolute path of a PDF or FDF file with notes

set_file_handling_preferences Set File Handling Preferences

Set and read file-handling preferences: image previews saved with files (macOS icon and full-size previews, Mac and Windows thumbnails), the length of File > Open Recent, and the History Log (on or off, saved to the file's metadata or a text file, and its detail). Call with no settings to read them

ParameterTypeDescription
fullSizePreviewbooleanmacOS: save a full-size preview
historyLogbooleanKeep the edit history log
historyLogDetailstringEdit log items
historyLogFilestringAbsolute path of the text file the History Log is written to
historyLogSaveTostringWhere the history log goes: the file's metadata (readable in File Info), a text file, or both
iconPreviewbooleanmacOS: save an icon preview
imagePreviewsstringSave image previews: always, never or ask when saving
macThumbnailbooleanmacOS: save a Macintosh thumbnail
recentFileListLengthintegerFiles listed in File > Open Recent
windowsThumbnailbooleanSave a Windows thumbnail

place_file Place File

Place an image, PDF, vector or other file in the active document as a smart object (File > Place Embedded), or as a smart object linked to the file (File > Place Linked), positioned, scaled and rotated

ParameterTypeDescription
filePath *stringAbsolute path of the file to place
anglenumberRotation in degrees
centerobjectWhere the placed item's centre goes, in pixels from the top-left. Default the document centre
linkedbooleanLink to the file instead of embedding it. Default false
scalenumberScale in percent, both directions
scaleXnumberHorizontal scale in percent
scaleYnumberVertical scale in percent

get_print_options Get Print Options

Read the active document's print settings (File > Print): the printer and the printers available, copies, colour handling, print space, rendering intent, position and scale, printing marks, functions and PostScript options

set_print_options Set Print Options

Change the active document's print settings (File > Print) without the dialog: printer, copies, colour handling (including separations), print space, rendering intent, black point compensation, hard proof, position and scale, printing marks, functions (emulsion down, negative, background, border, bleed) and PostScript options. Only the settings given change

ParameterTypeDescription
backgroundstringFunctions: page background colour. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)"
blackPointCompensationbooleanBlack point compensation
bleednumberFunctions: bleed width, pixels
bordernumberFunctions: border width, pixels
centerCropMarksbooleanPrinting marks: centre crop marks
colorBarsbooleanPostScript: colour calibration bars
colorHandlingstringPhotoshop manages colours, the printer manages colours, or print each channel as a separation
copiesintegerNumber of copies
cornerCropMarksbooleanPrinting marks: corner crop marks
descriptionbooleanPrinting marks: print the File Info description
flipbooleanFunctions: emulsion down (flip horizontally)
hardProofbooleanPrint a hard proof that simulates the Proof Setup device
interpolatebooleanPostScript: interpolation
labelsbooleanPrinting marks: print the document title
negativebooleanFunctions: negative
positionobjectPosition and scale on the page: centered, fit (scale to fit the media), or custom with x and y (pixels from the page's top-left) and scale (percent)
printSpacestringPrinter profile (print space) name; empty string for the same as the source
printerstringPrinter name, from get_print_options
registrationMarksbooleanPrinting marks: registration marks
renderingIntentstringRendering intent when the print space differs from the source
vectorDatabooleanPostScript: include vector data

print_image Print Image

Print the active document with its print settings and no Print dialog (File > Print), or print one copy with the current settings (File > Print One Copy). Set the printer and options first with set_print_options

ParameterTypeDescription
blackPointCompensationbooleanDefault true
oneCopybooleanPrint One Copy with the current settings; the other options do not apply. Default false
printSpacestringPrinter profile name. Default: the print settings' print space
renderingIntentstringDefault relative_colorimetric
sourcestringPrint the document's colours, or a hard proof of the Proof Setup. Default document

apply_trap Apply Trap

Add trapping to a CMYK document (Image > Trap): overlaps between adjacent colours that hide misregistration on press. The document must be in CMYK mode

ParameterTypeDescription
width *numberTrap width in pixels

get_photoshop_info Get Photoshop Info

Describe the running Photoshop (About Photoshop, System Info): version, build, locale, free memory, the preferences folder, the file types it opens, the script dialog mode, and optionally the full System Info report or whether named features are enabled

ParameterTypeDescription
featuresarrayFeature names to check with Application.featureEnabled, e.g. "photoshop/extended"
systemInfobooleanInclude the Help > System Info report (long). Default false

get_photoshop_preferences Get Photoshop Preferences

Read Photoshop's preferences (Photoshop > Settings, or Edit > Preferences on Windows) that scripts can reach: general, interface, file handling, performance, cursors, transparency, units and rulers, guides and grid, plug-ins, type, and the script dialog mode

set_photoshop_preferences Set Photoshop Preferences

Change Photoshop's preferences (Photoshop > Settings, or Edit > Preferences on Windows). Give only the settings to change; the result lists every preference afterwards. Some take effect after a restart

ParameterTypeDescription
additionalPluginFolderstringAbsolute path of the Additional Plug-ins Folder; also turns it on (Preferences > Plugins)
appendExtensionstringAppend File Extension: always, never or ask (Preferences > File handling)
askBeforeSavingLayeredTIFFbooleanAsk before saving layered TIFF files (Preferences > File handling)
autoUpdateOpenDocumentsbooleanAuto-update open documents changed on disk (Preferences > General)
beepWhenDonebooleanBeep When Done (Preferences > General)
cacheForHistogramsbooleanUse the image cache for histograms (Preferences > Performance)
cacheLevelsintegerCache Levels, 1-8 (Preferences > Performance)
colorPickerstringColor Picker (Preferences > General)
colorThemestringInterface colour theme, darkest to lightest (Preferences > Interface)
columnGutternumberColumn Size gutter, in points (Preferences > Units rulers)
columnWidthnumberColumn Size width, in points (Preferences > Units rulers)
dynamicColorSlidersbooleanDynamic Color Sliders (Preferences > General)
exportClipboardbooleanExport Clipboard to other applications (Preferences > General)
fontNamesInEnglishbooleanShow Font Names in English (Preferences > Type)
fontPreviewSizestringFont Preview Size in font menus (none turns previews off) (Preferences > Type)
gamutWarningOpacitynumberGamut Warning opacity, percent (Preferences > Transparency gamut)
gridStylestringGrid line style (Preferences > Guides grid slices)
gridSubdivisionsintegerGrid Subdivisions (Preferences > Guides grid slices)
guideStylestringGuide line style (Preferences > Guides grid slices)
historyStatesintegerHistory States kept per document (Preferences > Performance)
imagePreviewsstringImage Previews: always save, never save or ask when saving (Preferences > File handling)
interpolationstringImage Interpolation used when resampling (Preferences > General)
lowerCaseExtensionbooleanUse lower case file extensions (Preferences > File handling)
maxRAMusenumberMemory Usage: percentage of available RAM Photoshop may use (Preferences > Performance)
maximizeCompatibilitystringMaximize PSD and PSB File Compatibility: always, never or ask (Preferences > File handling)
otherCursorsstringOther Cursors (Preferences > Cursors)
paintingCursorsstringPainting Cursors (Preferences > Cursors)
pixelDoublingbooleanPixel doubling (legacy) (Preferences > Legacy)
pointSizestringPoint/Pica Size: PostScript (72 points/inch) or traditional (72.27 points/inch) (Preferences > Units rulers)
recentFileListLengthintegerRecent File List Contains, 0-100 files (Preferences > File handling)
rulerUnitsstringRulers units (this server still measures in pixels) (Preferences > Units rulers)
savePaletteLocationsbooleanRemember panel locations (Preferences > General)
scriptDialogsstringApplication.displayDialogs: whether other scripts and actions show dialogs (all, errors only or none). This server always runs its own scripts with dialogs off (Preferences > Scripting)
showAsianTextOptionsbooleanShow Asian text options (Preferences > Type)
showChannelsInColorbooleanShow Channels in Color (Preferences > Interface)
showSliceNumbersbooleanShow Slice Numbers (Preferences > Guides grid slices)
showToolTipsbooleanShow Tool Tips (Preferences > Interface)
smartQuotesbooleanUse Smart Quotes (Preferences > Type)
transparencyGridSizestringTransparency checkerboard Grid Size (Preferences > Transparency gamut)
typeUnitsstringType units (this server still measures in pixels) (Preferences > Units rulers)
uiFontSizestringUI Font Size (takes effect after a restart) (Preferences > Interface)
useAdditionalPluginFolderbooleanUse the Additional Plug-ins Folder (takes effect after a restart) (Preferences > Plugins)
useDiffusionDitherbooleanDiffusion dither (legacy) (Preferences > Legacy)
useShiftKeyForToolSwitchbooleanUse Shift Key for Tool Switch (whether a tool shortcut needs Shift to cycle through grouped tools) (Preferences > General)
useVideoAlphabooleanVideo alpha (legacy) (Preferences > Legacy)
zoomResizesWindowsbooleanZoom Resizes Windows (Preferences > General)

purge_photoshop_caches Purge Photoshop Caches

Free memory with Edit > Purge: the undo buffer, the clipboard, the histories of open documents, or all of them. It cannot be undone

ParameterTypeDescription
targetstringWhat to purge. Default all

run_photoshop_command Run Photoshop Command

Run an application command: beep, bring Photoshop to the front, redraw the screen, hide Photoshop or the other applications or show them all again (Photoshop menu, macOS only), open Help > Photoshop Help, or open the Creative Cloud account page in the browser

ParameterTypeDescription
command *stringThe command

run_photoshop_menu_item Run Photoshop Menu Item

Run any Photoshop menu command by its string id (e.g. "toggleRulers") or four-character id (e.g. "TglR"), as Application.runMenuItem does. A command that opens a dialog shows it and waits; prefer the specific tools

ParameterTypeDescription
charIDstringFour-character menu command id, e.g. "ZmIn"
stringIDstringMenu command string id, e.g. "screenModeFullScreen"

manage_script_options Manage Script Options

Store, read or erase named values that persist in Photoshop between sessions (Application.putCustomOptions, getCustomOptions and eraseCustomOptions), for keeping settings across calls

ParameterTypeDescription
action *stringget the values, set (replace) them, or erase them
key *stringA unique key, e.g. "com.example.myScript"
persistentbooleanset: keep after Photoshop quits. Default true
valuesobjectset: { name: string, number or boolean }. Names are letters, digits and underscores

quit_photoshop Quit Photoshop

Quit Photoshop (File > Exit, or Photoshop > Quit Photoshop on macOS). Refuses while documents have unsaved changes unless discardUnsaved is true, which closes them without saving first

ParameterTypeDescription
discardUnsavedbooleanClose documents with unsaved changes without saving them. Default false

arrange_photoshop_windows Arrange Photoshop Windows

Arrange document windows (Window > Arrange): tile, 2-up to 6-up, consolidate to tabs, cascade, float, open a new window for the active document, or match zoom, location or rotation across windows

ParameterTypeDescription
layout *stringThe Window > Arrange command

set_zoom_and_screen_mode Set Zoom And Screen Mode

Zoom the active document (View > Zoom In, Zoom Out, Fit on Screen, 100%, 200%, Print Size) and choose the screen mode (View > Screen Mode: standard, full screen with menu bar, full screen)

ParameterTypeDescription
screenModestringThe screen mode
zoomstringThe View menu zoom command

toggle_view_extras Toggle View Extras

Toggle View menu items for the active document: Extras, each View > Show item (layer and selection edges, target path, grid, guides, count, smart guides, slices, notes, pixel grid, brush preview), Rulers, Lock Guides, Lock Slices, Snap and each Snap To item. show_all, show_none, snap_to_all and snap_to_none set rather than toggle. Photoshop does not tell scripts whether an item is on

ParameterTypeDescription
items *arrayItems to toggle, in order

show_photoshop_panels Show Photoshop Panels

Show or hide panels (Window menu), hide or show all panels at once (Tab), reset to the Essentials workspace, and use the Histogram panel menu (compact, expanded or all-channels view, statistics, channels in colour, uncached refresh) and the Info panel's Color Samplers item

ParameterTypeDescription
hidearrayPanels to hide
histogramViewstringHistogram panel view
refreshHistogrambooleanHistogram panel Uncached Refresh
showarrayPanels to show
toggleAllPanelsbooleanHide all panels, or show them again (Application.togglePalettes)
toggleHistogramarrayHistogram panel options to toggle
toggleInfoColorSamplersbooleanToggle the Info panel menu's Color Samplers item
workspacestringSwitch to Window > Workspace > Essentials (Default)

select_view_tool Select View Tool

Make a view tool current in the Tools panel: Hand, Zoom, Rotate View (needs the graphics processor), Slice or Slice Select. Using the tool on the canvas stays with the user

ParameterTypeDescription
tool *stringThe tool

edit_photoshop_guides Edit Photoshop Guides

Work with guides in the active document (View > Guides): add guides at pixel positions, lay out columns, rows and margins (New Guide Layout), make guides from the selected shape layer (New Guides From Shape), clear all guides or only canvas guides, or clear slices (View > Clear Slices). Returns the guides afterwards

ParameterTypeDescription
action *stringWhat to do
clearExistingbooleanlayout: remove existing guides first. Default true
columnsintegerlayout: number of columns
directionstringadd: guide direction
gutternumberlayout: space between columns and between rows, in pixels. Default 0
marginobjectlayout: margins in pixels; a guide is placed at each margin given
positionsarrayadd: pixel positions from the top (horizontal) or left (vertical) edge
rowsintegerlayout: number of rows
targetobjectfrom_shape: the shape layer. Default the active layer

open_raw_file Open Raw File

Open a camera raw file through Camera Raw without its dialog, with the camera's defaults, the settings last used, or custom Basic, Detail, Lens and Calibration values and Workflow Options (colour space, bit depth, size, resolution). These are the object model's older Camera Raw controls

ParameterTypeDescription
filePath *stringAbsolute path to the raw file
bitsPerChannelintegerWorkflow Options: bit depth
brightnessnumberBrightness, 0-150 (process versions 2003 and 2010)
calibrationobjectCalibration: hue and saturation of each primary and the shadow tint, each -100 to 100
chromaticAberrationBYnumberChromatic aberration blue/yellow, -100 to 100
chromaticAberrationRCnumberChromatic aberration red/cyan, -100 to 100
colorNoiseReductionnumberColor noise reduction, 0-100
colorSpacestringWorkflow Options: colour space
contrastnumberContrast, -50 to 100
exposurenumberExposure in stops, -4 to 4
luminanceSmoothingnumberLuminance noise reduction, 0-100
resolutionnumberWorkflow Options: resolution, pixels per inch
saturationnumberSaturation, -100 to 100
settingsstringcamera (Camera Raw defaults), selected_image (the settings last used) or custom (the values given). Default custom when values are given, otherwise camera
shadowsnumberShadows, 0-100
sharpnessnumberSharpening amount, 0-100
sizestringWorkflow Options: image size
temperaturenumberWhite balance temperature in kelvin, 2000-50000
tintnumberWhite balance tint, -150 to 150
vignettingAmountnumberLens vignetting amount, -100 to 100
vignettingMidpointnumberLens vignetting midpoint, -100 to 100
whiteBalancestringWhite balance preset

apply_camera_raw_settings Apply Camera Raw Settings

Apply Filter > Camera Raw Filter to layers without its dialog, with the settings of its panels: Basic (white balance, exposure, contrast, highlights, shadows, whites, blacks, texture, clarity, dehaze, vibrance, saturation), Curve (parametric regions and splits, point curves, refine saturation), Detail (sharpening, noise reduction), Color Mixer (HSL), Color Grading (wheels, blending, balance), Optics (lens vignetting, defringe), Effects (vignette, grain) and Masking (local corrections through linear gradient, radial gradient and luminance range masks; these replace any local corrections the fil…

apply_neural_filter Apply Neural Filter

Run a Neural Filter (Filter > Neural Filters) on the active layer without its workspace: Depth Blur, Style Transfer or Photo Restoration. The filter must already be downloaded in the Neural Filters panel; some filters process in the cloud and need a signed-in Adobe account

ParameterTypeDescription
filter *stringThe filter
optionsobjectSliders, 0-100. depth_blur: aperture, focalDistance, focalRange, haze. style_transfer: brushSize, preserveWeight, blur. photo_restoration: enhance (Photo Enhancement), faceEnhance (Enhance Face), scra…
preserveColorbooleanstyle_transfer: keep the image's colours. Default false
stylestringstyle_transfer: preset style id. Default "style28_crop"

replace_sky Replace Sky

Replace the sky in the active document (Edit > Sky Replacement) with an image file, without the dialog. Photoshop finds the sky, adds a Sky Replacement group with the new sky and lighting and colour layers, and returns it. Edge, brightness, temperature, lighting and colour settings match the dialog's

ParameterTypeDescription
skyFile *stringAbsolute path to the sky image (a Sky_Presets image or any JPEG or PNG)
brightnessnumberSky brightness, -100 to 100. Default 0
colorAdjustmentnumberColor Adjustment, 0-100. Default 50
edgeLightingnumberEdge Lighting, 0-100. Default 50
fadeEdgenumberFade Edge, 0-100. Default 25
foregroundLightingnumberForeground Lighting adjustment, 0-100. Default 50
lightingModestringLighting mode for the foreground lighting layer. Default screen; Photoshop may choose its own blend from the sky
outputstringOutput to new layers (default) or a duplicate layer
shiftEdgenumberShift Edge, -100 to 100. Default 0
temperaturenumberSky temperature, -100 to 100. Default 0

remove_background Remove Background

Remove the background of layers (the Properties panel's Remove Background quick action): Photoshop finds the subject and adds a layer mask hiding the rest. It uses the Select Subject model, which may process in the cloud depending on Preferences > Image Processing

ParameterTypeDescription
targetobjectLayers. Default the active layer

generative_fill Generative Fill

Generative Fill (Edit > Generative Fill) inside the current selection: generate content from a prompt, or with an empty prompt remove what is selected and fill from the surroundings. Results go to a new Generative Layer. Needs a selection, Photoshop signed in to an Adobe account and an internet connection; uses generative credits

ParameterTypeDescription
contentTypestringContent type: none (automatic, default), photo or art
promptstringWhat to generate in the selection; empty or omitted to remove the selected content
seedintegerSeed for repeatable results; -1 (default) picks one at random

generate_image Generate Image

Generate Image (Edit > Generate Image): create an image from a text prompt as a new layer filling the active document. Needs Photoshop signed in to an Adobe account and an internet connection; uses generative credits

ParameterTypeDescription
prompt *stringWhat to generate, in English
contentTypestringContent type: none (automatic, default), photo or art
seedintegerSeed for repeatable results; -1 (default) picks one at random

harmonize_layer Harmonize Layer

Harmonize a layer with the image beneath it (the Properties panel's Harmonize): match its light, colour and shadows to the background. Results go to a new layer. Needs Photoshop signed in to an Adobe account and an internet connection; uses generative credits

ParameterTypeDescription
seedintegerSeed for repeatable results; -1 (default) picks one at random
targetobjectThe layer to harmonize (the first one given). Default the active layer

photoshop_status Photoshop Status

Check that Photoshop is reachable: platform, how the server addresses Photoshop, whether it is running, its version and open documents. Use this first when a call fails to connect

ParameterTypeDescription
probebooleanAsk Photoshop for its version and documents (starts Photoshop if it is not running). Default true

play_action Play Action

Play an action from the Actions panel by its name and set. Dialogs in the action stay closed and use their recorded settings

ParameterTypeDescription
action *stringAction name, e.g. "Vignette (selection)"
set *stringAction set name, e.g. "Default Actions"

execute_photoshop_code Execute Photoshop Code

Run your own ExtendScript in Photoshop and return its last expression. It runs unrestricted: it can change or delete anything and read or write files. Prefer the specific tools

ParameterTypeDescription
code *stringExtendScript (ES3) source

help Help

List the tools by area, or describe one tool's parameters

ParameterTypeDescription
toolstringA tool name