Code Snippets Photoshop Scripting Archive

Photoshop Script – Code Snippet Archive

0

This post has already been read 1420 times!

Collection of some useful photoshop code snippets, functions and etc…

Color Fill to Shape Layer

Center Layer

 

Clear Guides via Extendscript

 

Run any menu item using doMenuItem command

Selecting Specific Tool

Sample usage;

Replace”paintbrushTool” with the desired tool names below;

moveTool
marqueeRectTool
marqueeEllipTool
marqueeSingleRowTool
marqueeSingleColumnTool
lassoTool
polySelTool
magneticLassoTool
quickSelectTool
magicWandTool
cropTool
sliceTool
sliceSelectTool
spotHealingBrushTool
magicStampTool
patchSelection
redEyeTool
paintbrushTool
pencilTool
colorReplacementBrushTool
cloneStampTool
patternStampTool
historyBrushTool
artBrushTool
eraserTool
backgroundEraserTool
magicEraserTool
gradientTool
bucketTool
blurTool
sharpenTool
smudgeTool
dodgeTool
burnInTool
saturationTool
penTool
freeformPenTool
addKnotTool
deleteKnotTool
convertKnotTool
typeCreateOrEditTool
typeVerticalCreateOrEditTool
typeCreateMaskTool
typeVerticalCreateMaskTool
pathComponentSelectTool
directSelectTool
rectangleTool
roundedRectangleTool
ellipseTool
polygonTool
lineTool
customShapeTool
textAnnotTool
soundAnnotTool
eyedropperTool
colorSamplerTool
rulerTool
handTool
zoomTool

 

 

Remove All Empty Layer Groups – Extendscript Snippet

 

Remove All Invisible – Hidden Layers – Extendscript Snippet

 

Copy to a New Layer Extendscript Snippet

Showing Color Picker in ExtendScript

History States & Snapshots Iteration

This script iterates through history states and snapshots in an active document and checks if any snapshot name matches with given string value; (Resulting boolean; true or false)

Remove History State – Snapshot with Name

Working with Paths

Count number of paths in document

Count number of points in first sub path.

More Details about sub paths and points count;

Adding a Simple Path

Draw Shape

Sorting Layers in an Alphabetical Order

Create History Snapshot Function

Merge Visible Layers

Finding Layer Count;

Add Prefix to Selected Layers

Activate all layer(s) containing given characters.

(In this example;  Row)

Replace the word ‘Row’. (Between //)

Create desired number of rows & columns and save them as png with prefix

 

Leave a Reply