Skip to main content
Participant
April 4, 2014
Question

editing Save for Web output settings with script

  • April 4, 2014
  • 1 reply
  • 671 views

I'm just curious if it is possible to edit the Save for Web Output Settings in a script (Not the save for web options, but the "Edit Output Settings" in the drop down menu). I figured it would be somewhere under the .options, but I'm not finding anything.

This topic has been closed for replies.

1 reply

pixxxelschubser
Community Expert
Community Expert
April 5, 2014

You can find examples here in forum.

Here is one by Paul Riggott:

Paul Riggott wrote:

Here you are...

function main(){
if(!documents.length) return;
var Name = app.activeDocument.name.replace(/\.[^\.]+$/, ''); 
var saveFile = File(Folder.desktop + "/" + Name + ".jpg");
if(saveFile.exists){
   if(!confirm("Overwrite existing document?")) return;
    saveFile.remove();
    }
SaveForWeb(saveFile,100); //change to 60 for 60%
}
main();
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb(); 
   sfwOptions.format = SaveDocumentType.JPEG; 
   sfwOptions.includeProfile = false; 
   sfwOptions.interlaced = 0; 
   sfwOptions.optimized = true; 
   sfwOptions.quality = jpegQuality; //0-100 
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);
}

Have fun

wyf51999
Inspiring
April 24, 2016

That's great!

Is it possible to add 2 more things in this code?

1, transform to sRGB

2, original folder

Thanks.