Find these lines in the script
case jpegIndex:
docRef.bitsPerChannel = BitsPerChannelType.EIGHT;
var saveFile = new File(exportInfo.destination + "/" + fileNameBody + ".jpg");
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = exportInfo.icc;
jpgSaveOptions.quality = exportInfo.jpegQuality;
docRef.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);
break;
Replace with this
case jpegIndex:
docRef.bitsPerChannel = BitsPerChannelType.EIGHT;
var saveFile = new File(exportInfo.destination + "/" + fileNameBody + ".jpg");
var exportOpts = new ExportOptionsSaveForWeb( );
exportOpts.format = SaveDocumentType.JPEG
exportOpts.includeProfile = exportInfo.icc;
exportOpts.quality = Math.round( exportInfo.jpegQuality / 12 * 100 ) ); // exportInfo.jpegQuality is 0 to 12, SFW uses 0 to 100. this converts
if ( saveFile.exists ) saveFile.remove( );// avoid file exists overwrite dialog
docRef.exportDocument( saveFile, ExportType.SAVEFORWEB, exportOpts );
break;
And that should do it. Or you could adjust so it uses scriptlistner for the SFW like the script does for PNG. If you want the jpeg to keep some metadata you will need to use scriptlistner anyway as the DOM version doesn't allow metadata in export.