1 person found this helpful
I would have thought it would ask about replacing the existing file on either platform. However a simple fix would be to remove the file before runnig the export.
Thank you! It works with removal
(but in fact, I really don't have to delete a file on Mac, script replaces it without asking)
I think it would probably be easier to do it this way. I use this code across windows and mac and it works great and never asks to replace;
var Qlt = 50 //// whatever quality you want to save it as.
var FileNm = new File ((activeDocument.path) + "/" + (activeDocument.name)); ///// the path to your file
ExpWeb(FileNm, Qlt); //// performs export for web
///////// Export for web function
function ExpWeb(FileNm, Qlt)
var options = new ExportOptionsSaveForWeb();
options.quality = Qlt; // Start with highest quality (biggest file).
options.format = SaveDocumentType.JPEG; // Save Format for the file
activeDocument.exportDocument(new File(FileNm), ExportType.SAVEFORWEB, options);