Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

Re: call save for web and devices dialog

$
0
0

Hi rajaramasami,

You can find examples e.g. in JavaScript for Save for Web here in forum.

 

Here is one, written 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

 


Viewing all articles
Browse latest Browse all 27456

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>