如何在 Photoshop 脚本中设置文件夹?

How do I set the folder on a Photoshop script?

我想为保存文件的 Photoshop 编写脚本。但我不知道如何设置命运文件夹。请帮忙。

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

不使用 web 导出选项可能更容易:

// 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);

只需将 myfilePath 设置为您想要的 (C:\myfolder\myfile.jpg)