Currently, I am in the process of developing a JavaScript script for Photoshop. The main objective of this script is to prompt the user to choose a folder containing multiple files. Subsequently, the script will open each file within the folder and perform specific actions based on the filenames.
Although I have managed to successfully open all the files and apply a single action to them, I am encountering difficulties when it comes to executing different actions for different files.
The structure of the folders would typically include:
(1-18 selected or files with less than 3 characters in their names)
1.psd
2.psd
...
18.psd
(files with "-" in their names)
GHHJKK-1.psd GHHJKK-2.psd ... GHHJKK-5.psd
(files containing the string "zoom" in their names)
zoom_side.psd
zoom_sole.psd
Here is a brief overview of what I have accomplished so far:
#target photoshop
var inputFolder = Folder.selectDialog("Select a folder of documents to process");
function open360() {
var filesOpened = 0;
var fileList = inputFolder.getFiles();
for ( var i = 0; i < fileList.length; i++ ) {
open( fileList[i] );
filesOpened++;
}
}
open360();
var doc = app.activeDocument;
function shoeSFW() {
/*if (doc.filename.length < 3 ) {
app.doAction("Zoom Side and Sole 360 SFW", "New SFW Actions");
}
*/
for(i = app.documents.length; i > 0; i--){
if(app.documents.length != 0){
doc = app.doAction("360 Shoes SFW", "New SFW Actions");
}
}
}
shoeSFW();
I would greatly appreciate any assistance with modifying the script to achieve the desired functionality for different types of files. Thank you in advance!