How do I set the folder on a Photoshop script?

247 views Asked by At

I want to write a script for Photoshop that save the files. But I don't know how to set the destiny folder. Please, help.

app.activeDocument.save()
ExportOptionsSaveForWeb.format - SaveDocumentType.JPEG;
ExportOptionsSaveForWeb.quality = 40;
ExportOptionsSaveForWeb
app.exportDocument (exportIn, exportAs, options)
1

There are 1 answers

0
Ghoul Fool On BEST ANSWER

It's probably easier not to use the export for web options:

// jpg file options
var jpgFile = new File(myfilePath);
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.formatOptions = FormatOptions.OPTIMIZEDBASELINE;
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = 40;

activeDocument.saveAs(jpgFile, jpgSaveOptions, true, Extension.LOWERCASE);

Just set myfilePath to be what ever you want (C:\myfolder\myfile.jpg)