ExtendScript Save PNG as JPEG without dialog
I've written a script in ExtendScript to process hundreds of image files. It works fine without any intervention if the original files are JPEGs. I however have started getting some PNG's. The script opens them fine and converts them to RGB. I set my JPEG save Options but when PS goes to save it brings up the Save As dialog box. Is there any way to avoid the dialog box?
My code:
var destFile = File(printFolder.fullName + "/" + doc.name);
var saveOptions = new JPEGSaveOptions( );
saveOptions.embedColorProfile = true;
saveOptions.quality = 12;
saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
saveOptions.matte = MatteType.NONE;
doc.saveAs (destFile, saveOptions, false );
