Photoshop Script - resizing images in a folder (dialog box)

I would like to know if there is an easy way to write a simple script in Photoshop.

I would like it to open a dialog so that the user can select a folder. Then the scripts create another folder ("web_ready") inside the selected one and place the modified images into it. I can easily handle the resizing part (there are a lot of tutorials on the Internet), but I don’t know how to write a part with a pop-up dialog box. Could you help me? I am talking about * .jsx scripts.

+3
source share
1 answer

Folder selection dialog:

var inputFolder = Folder.selectDialog("Select a folder to process");

Get files from folder:

var fileList = inputFolder.getFiles("*.JPG"); //Use whatever extension you want or no extension to select all files

Do something with the files:

for(var i=0; i<fileList.length; i++) {
    //do something..
}
+17
source

All Articles