Answered
saveAs() function causes disk error when called from javascript in Photoshop 25.3
Although the following script worked previous, it appears to fail now with a disk error (-43).
Anyone else see this? Any fixes or workarounds?
// Define the file path where you want to save the file
var filePath = "C:/Users/<myusername>/Desktop/file.jpg";
// Create a new File object with the file path
var jpgFile = new File(filePath);
// Define the JPEG save options
var jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = 12;
// Save the active document with the defined file and JPEG save options
app.activeDocument.saveAs(jpgFile, jpgSaveOptions, true, Extension.LOWERCASE);
