This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| // Close all open files | |
| var docs = app.documents; | |
| for (var i = docs.length - 1; i >= 0; i--) { | |
| docs[i].close(SaveOptions.DONOTSAVECHANGES); | |
| } | |
| */ | |
| // or this one: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //community.adobe.com/t5/photoshop/modify-script-to-create-a-specific-name-for-new-layer/m-p/10843395#M295794 | |
| /* | |
| // Standard DOM code: | |
| app.activeDocument.artLayers.add(); | |
| app.activeDocument.activeLayer.name = 'Red'; | |
| */ | |
| /* | |
| // ActionDescriptor Code: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Select all layers and sets.jsx | |
| Thanks to Paul Riggott | |
| */ | |
| selectAllLayers(); | |
| function selectAllLayers(layer) { | |
| if (layer === undefined) layer = 0; | |
| activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length - 1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| // Loop the input prompt until a number is entered | |
| var origInput; | |
| while (isNaN(origInput = prompt("Enter a whole number:", "3"))); | |
| // Test if cancel returns null, then terminate the script | |
| if (origInput === null) { | |
| alert('Script cancelled!'); | |
| return | |
| } | |
| // Test if an empty string is returned, then terminate the script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Align Active Layer to Canvas.jsx | |
| /* | |
| ADSLefts = Align Left | |
| ADSRights = Align Right | |
| ADSCentersH = Align Centre Horizontal | |
| ADSTops = Align Top | |
| ADSBottoms = Align Bottom | |
| ADSCentersV = Align Centre Vertical | |
| null = insert "null" to quickly disable one of the two alignment options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Align Active Layer to Select All.jsx | |
| // Change as required | |
| align2SelectAll('AdCH'); | |
| align2SelectAll('AdCV'); | |
| function align2SelectAll(method) { | |
| //www.ps-scripts.com/viewtopic.php?f=66&t=7036&p=35273&hilit=align+layer#p35273 | |
| /* | |
| //macscripter.net/viewtopic.php?id=38890 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var selectFile = File.openDialog("Please select the file:"); | |
| open(selectFile); | |
| // or | |
| var selectFile = app.openDialog(); | |
| open(File(selectFile)); | |
| // or using AM code: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* open an entire folder */ | |
| // Open the input folder | |
| var inputFolder = Folder.selectDialog('Please select a folder:'); | |
| // Only open listed file extensions | |
| var inputFiles = inputFolder.getFiles(/\.(jpg|jpeg|tif|tiff|psd|psb|eps|png|bmp|gif)$/i); | |
| // Alpha numeric sort | |
| inputFiles.sort(); | |
| // inputFiles.sort.reverse(); | |
| // Loop through the inFolder... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* open selected files from folder */ | |
| //community.adobe.com/t5/photoshop/open-selected-files/m-p/11632735 | |
| var aFile = selectFile(true); | |
| for (var i = 0; i < aFile.length; i++) { | |
| open(File(aFile[i])); | |
| } | |
| ////// select file ////// | |
| function selectFile(multi) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Active Layer Inspector.jsx | |
| Stephen Marsh | |
| v1.9 - 21st June 2025 | |
| https://community.adobe.com/t5/photoshop-ecosystem-discussions/could-you-select-all-layers-sequentially/td-p/11732510/page/3#U12078337 | |
| https://gist.githubusercontent.com/MarshySwamp/ef345ef3dec60a843465347ee6fcae2f/raw/3f4ebef778bbc841f5c27f2744b79b6044145fbc/Active%2520Layer%2520Inspector.jsx | |
| Displays info about the current layer, useful for script development and debugging | |
| Related script for all layers: | |
| https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-copy-multiple-layer-names/m-p/13118781#U15263262 | |
| */ |