ops payloads. Canonical names and handlers are defined in photoshop-uxp-bridge/index.js.
Shared conventions
targetcan be omitted for layer-targeted ops if an active layer is selected; otherwise pass one of: layer name ("Hero"), layer id ("123"), or object ({ "layerName": "Hero" }/{ "layerId": "123" }).docRef/targetfor document ops defaults to the active document when omitted.- Ref assignment keys supported on any op:
ref,refId,as,outputRef,storeAs,idRef. - Alias names listed below resolve to the same canonical op. Prefer canonical names in new prompts.
formatfor export/save ops accepts common image/doc formats (png,jpg,psd), resolved by Photoshop save/export APIs.- All examples are single-op snippets intended for the
opsarray.
Documents
createDocument
- Aliases:
doc.create,document.create,newDocument - Required: None
- Supported args:
depth,fill,height,mode,name,preset,profile,resolution,width
openDocument
- Aliases:
doc.open,document.open - Required:
input (or path/source) - Supported args:
input,path,source
duplicateDocument
- Aliases:
doc.duplicate,document.duplicate - Required: None
- Supported args:
docRef,mergeLayersOnly,name,target
saveDocument
- Aliases:
doc.save,document.save - Required: None
- Supported args:
allowDialog,asCopy,docRef,options,output,quality,target
saveDocumentAs
- Aliases:
doc.saveAs,document.saveAs - Required:
output - Supported args:
docRef,target,output,format,quality,asCopy,options
closeDocument
- Aliases:
doc.close,document.close - Required: None
- Supported args:
docRef,mode,output,save,saveChanges,saveOption,target
resizeImage
- Aliases:
document.resizeImage - Required:
widthand/orheight - Supported args:
docRef,height,resolution,target,width
resizeCanvas
- Aliases:
document.resizeCanvas - Required:
width,height - Supported args:
anchor,docRef,height,target,width
cropDocument
- Aliases:
document.crop - Required:
bounds {left, top, right, bottom}(or top-levelleft/top/right/bottom) - Supported args:
angle,bounds,docRef,height,target,width
trimDocument
- Aliases:
document.trim - Required: None
- Supported args:
bottom,docRef,left,right,target,top,trimType
rotateDocument
- Aliases:
document.rotate - Required:
angle - Supported args:
anchor,angle,docRef,options,target
flattenDocument
- Aliases:
flattenImage,document.flatten - Required: None
- Supported args:
docRef,target
mergeVisible
- Aliases:
mergeVisibleLayers,document.mergeVisibleLayers - Required: None
- Supported args:
docRef,target
Layers and grouping
createLayer
- Aliases:
layer.create - Required: None
- Supported args:
blendMode,docRef,fillNeutral,kind,name,opacity
createPixelLayer
- Aliases:
layer.createPixel - Required: None
- Supported args:
blendMode,docRef,fillNeutral,kind,name,opacity
createGroup
- Aliases:
createLayerGroup,layer.createGroup - Required: None
- Supported args:
blendMode,docRef,fromLayers,name,opacity
groupLayers
- Aliases:
layer.group - Required:
targets[] - Supported args:
docRef,name,targets
ungroupLayer
- Aliases:
layer.ungroup - Required: None
- Supported args: No op-specific args
deleteLayer
- Aliases:
layer.delete - Required:
target (or active layer) - Supported args: No op-specific args
renameLayer
- Aliases:
layer.rename - Required:
target (or active layer),name (or newName) - Supported args:
name
duplicateLayer
- Aliases:
layer.duplicate - Required:
target (or active layer) - Supported args:
insertionLocation,name,placement,relativeTo
selectLayer
- Aliases:
layer.select - Required:
target (or active layer) - Supported args: No op-specific args
selectLayers
- Aliases:
layer.selectMany - Required:
targets[] - Supported args:
targets
moveLayer
- Aliases:
layer.move,reorderLayer,layer.reorder - Required:
target (or active layer),one of: by{x,y}, relativeTo+placement, to(front/back), or index/at - Supported args:
at,by,index,insertLocation,placement,relativeTo,to
setLayerVisibility
- Aliases:
layer.visibility - Required:
target (or active layer),visible - Supported args:
visible
showLayer
- Aliases:
layer.show - Required:
target (or active layer) - Supported args: No op-specific args
hideLayer
- Aliases:
layer.hide - Required:
target (or active layer) - Supported args: No op-specific args
setLayerOpacity
- Aliases:
layer.opacity - Required:
target (or active layer),opacity - Supported args:
opacity
setBlendMode
- Aliases:
layer.blendMode - Required:
target (or active layer),blendMode - Supported args:
blendMode
setLayerProps
- Aliases:
layer.setProps - Required:
target (or active layer) - Supported args:
blendMode,locked,opacity,visible
bringLayerToFront
- Aliases:
layer.bringToFront - Required:
target (or active layer) - Supported args: No op-specific args
sendLayerToBack
- Aliases:
layer.sendToBack - Required:
target (or active layer) - Supported args: No op-specific args
mergeLayer
- Aliases:
mergeLayers,layer.merge - Required:
target (or active layer) - Supported args:
name,targets
rasterizeLayer
- Aliases:
layer.rasterize - Required:
target (or active layer) - Supported args:
rasterizeType,targetType
linkLayers
- Aliases:
layer.link - Required:
targets[] - Supported args:
targets
unlinkLayer
- Aliases:
layer.unlink - Required:
target (or active layer) - Supported args: No op-specific args
Transforms and layout
transformLayer
- Aliases:
layer.transform - Required:
target (or active layer) - Supported args:
angle,angleH,angleV,axis,by,flip,height,horizontal,percent,rotate,scale,scaleX,scaleY,skewX,skewY,translate,vertical,width,x,y
alignLayers
- Aliases:
layer.align - Required: at least 2 layers via
targets[]or current active selection - Supported args:
targets,axis,type
distributeLayers
- Aliases:
layer.distribute - Required: at least 3 layers via
targets[]or current active selection - Supported args:
targets,axis,type
translateLayer
- Aliases:
layer.translate - Required:
target (or active layer),x/y or horizontal/vertical - Supported args:
by,horizontal,vertical,x,y
scaleLayer
- Aliases:
layer.scale - Required:
target (or active layer),scaleX/scaleY or width/height or scale/percent - Supported args:
anchor,height,options,percent,scale,scaleX,scaleY,width
rotateLayer
- Aliases:
layer.rotate - Required:
target (or active layer),angle - Supported args:
anchor,angle,options
flipLayer
- Aliases:
layer.flip - Required:
target (or active layer),axis - Supported args:
axis
skewLayer
- Aliases:
layer.skew - Required:
target (or active layer),angleH and/or angleV - Supported args:
angleH,angleV,horizontal,options,vertical
Assets and smart objects
placeAsset
- Aliases:
asset.place - Required:
input (or path/source) - Supported args:
input,linked,name,normalizePixels,path,source,transformOptions
convertToSmartObject
- Aliases:
smartObject.convert - Required:
target (or active layer) - Supported args:
preserveName
replaceSmartObject
- Aliases:
smartObject.replace - Required:
target (or active layer),input (or path/source) - Supported args:
crop,input,pageNumber,path,preserveName,source
relinkSmartObject
- Aliases:
smartObject.relink - Required:
target (or active layer),input (or path/source) - Supported args:
input,path,preserveName,source
editSmartObject
- Aliases:
smartObject.edit - Required:
target (or active layer) - Supported args: No op-specific args
Selection and masks
selectAll
- Aliases:
selection.selectAll - Required: None
- Supported args:
docRef
deselect
- Aliases:
selection.deselect - Required: None
- Supported args:
docRef
inverseSelection
- Aliases:
invertSelection,selection.inverse - Required: None
- Supported args:
docRef
featherSelection
- Aliases:
selection.feather - Required:
by or radius - Supported args:
applyEffectAtCanvasBounds,by,docRef,radius
expandSelection
- Aliases:
selection.expand - Required:
by - Supported args:
applyEffectAtCanvasBounds,by,docRef
contractSelection
- Aliases:
selection.contract - Required:
by - Supported args:
applyEffectAtCanvasBounds,by,docRef
growSelection
- Aliases:
selection.grow - Required:
by or tolerance - Supported args:
by,docRef,tolerance
smoothSelection
- Aliases:
selection.smooth - Required:
radius - Supported args:
applyEffectAtCanvasBounds,docRef,radius
selectRectangle
- Aliases:
selection.selectRectangle - Required:
bounds {left,top,right,bottom} - Supported args:
antiAlias,bounds,docRef,feather,mode
selectEllipse
- Aliases:
selection.selectEllipse - Required:
bounds {left,top,right,bottom} - Supported args:
antiAlias,bounds,docRef,feather,mode
selectPolygon
- Aliases:
selection.selectPolygon - Required:
points[3+] - Supported args:
antiAlias,docRef,feather,mode,points
selectLayerPixels
- Aliases:
selection.loadLayerPixels - Required:
target (or active layer) - Supported args:
docRef,invert,mode
setSelection
- Aliases:
selection.set - Required: shape-dependent coordinates (
rect/ellipse:x,y,width,height;polygon:points[3+]) - Supported args:
shape,type,x,y,left,top,width,height,points,mode,feather,antiAlias
modifySelection
- Aliases:
selection.modify - Required:
modeplus mode-specific args (expand/contract:by;feather/smooth:radius;grow:byortolerance) - Supported args:
mode,by,radius,tolerance,applyEffectAtCanvasBounds
createLayerMask
- Aliases:
layerMask.create - Required:
target (or active layer) - Supported args:
forceBatchPlay,fromSelection,hideAll
addLayerMask
- Aliases:
layerMask.add - Required:
target (or active layer) - Supported args:
forceBatchPlay,fromSelection,hideAll
deleteLayerMask
- Aliases:
layerMask.delete - Required:
target (or active layer) - Supported args:
apply,forceBatchPlay
removeLayerMask
- Aliases:
layerMask.remove - Required:
target (or active layer) - Supported args:
apply,forceBatchPlay
applyLayerMask
- Aliases:
layerMask.apply - Required:
target (or active layer) - Supported args: No op-specific args
Adjustments and filters
createAdjustmentLayer
- Aliases:
adjustment.create - Required: None (
levelsdefault when omitted) - Supported args:
adjustment,name,type
applyFilter
- Aliases:
filter.apply - Required:
filter (or kind) - Supported args:
filter,kind
applyGaussianBlur
- Aliases:
filter.gaussianBlur - Required:
target (or active layer),radius - Supported args:
radius
applyUnsharpMask
- Aliases:
filter.unsharpMask - Required:
target (or active layer),amount, radius, threshold - Supported args:
amount,radius,threshold
applySharpen
- Aliases:
filter.sharpen - Required:
target (or active layer) - Supported args: No op-specific args
applyBlur
- Aliases:
filter.blur - Required:
target (or active layer) - Supported args: No op-specific args
Text and shapes
createTextLayer
- Aliases:
text.create - Required:
text (or contents) - Supported args:
avoidOverlapWith,contents,docRef,ellipsis,font,fontName,fontSize,hardMinFontSize,maxHeight,maxWidth,minFontSize,name,overflow,overflowMode,overlapGap,position,text
setText
- Aliases:
text.set - Required:
target (or active layer),text (or contents) - Supported args:
contents,text
setTextStyle
- Aliases:
text.style - Required:
target (or active layer),at least one style/content field - Supported args:
avoidOverlapWith,contents,ellipsis,font,fontName,fontSize,hardMinFontSize,maxHeight,maxWidth,minFontSize,overflow,overflowMode,overlapGap,position,text
createShapeLayer
- Aliases:
shape.create - Required:
bounds or x/y/width/height - Supported args:
bounds,color,fill,height,name,shape,shapeType,width,x,y
Export and low-level
export
- Aliases:
document.export,render - Required:
output - Supported args:
docRef,target,output,format,quality,metadata,sRGB,options
exportDocument
- Aliases:
document.exportDocument - Required:
output - Supported args:
docRef,output,format,quality,metadata,sRGB,options
exportLayer
- Aliases:
document.exportLayer - Required:
target (or active layer),output - Supported args:
target,docRef,output,format,quality,metadata,sRGB,options
exportLayersByName
- Aliases:
document.exportLayersByName - Required:
match,outputDir (or output) - Supported args:
docRef,format,match,output,outputDir
batchPlay
- Aliases:
action.batchPlay - Required:
commands[] or command/descriptor - Supported args:
allowUnavailable,command,commands,descriptor,options