Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Photoshop Script - resize images in 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 pop a dialog box to let user select a folder. Then the scripts creates another folder ("web_ready") inside selected one and put resized images into it. I can handle the resizing part pretty easily (there is a lot of tutorials on the web) but i don't know how to write the part with dialog box pop-up. Can you help me? I am talking about *.jsx scripts.

like image 276
bwitkowicz Avatar asked Dec 02 '22 22:12

bwitkowicz


1 Answers

Folder select dialog:

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

Get the files from the 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..
}
like image 197
pdizz Avatar answered Dec 10 '22 11:12

pdizz