Copy link to clipboard
Copied
this is my question:
i'v created an action to save my files into 3 different size,and each size should be save into the corresponding folder.
the problem is,i use this code to create folder
var myFolder = Folder("/d/project/Size300X300");
if(!myFolder.exists) myFolder.create();
//load the action to save file
var myFolder = Folder("/d/project/Size200X200");
if(!myFolder.exists) myFolder.create();
//load the action to save file
var myFolder = Folder("/d/project/Size75X75");
if(!myFolder.exists) myFolder.create();
//load the action to save file
then how can i load the action so that i can process: create folder -> save file
thank U
Copy link to clipboard
Copied
First of all, I would use a different variable for each folder. Dependiing upon the file type you want to save, you need to define the files parameters. For example if you're saving jpgs:
docRef = activeDocument
var jpgOptions = new JPEGSaveOptions();
jpgOptions.quality = 10;
docRef.saveAs (new File(myFolder +'/' + docRef.name.split('.')[0] + '.jpg'), jpgOptions);
Copy link to clipboard
Copied
To csuebele
in the action i created many slices to save the file into 3 differents sizes. However, I'm not sure how to use the script to creat slices that are exactly the same with the previous ones I created.
Copy link to clipboard
Copied
By "load action" are you referring to simply running a specific action, or actually loading it into the Photoshop action list from a .atn file and then running it?
Copy link to clipboard
Copied
yep
the action i've created, "//load the action to save file" means to load it into the script, and then run it