2 Replies Latest reply on Jul 28, 2016 1:33 PM by tomzag

    change save as script of png to jpg

    abhijeett89122812 Level 1

      hello, below is the script to save as png...

       

      main();

      function main(){

      var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');

      var Ext = decodeURI(app.activeDocument.name).replace(/^.*\./,'');

      if(Ext.toLowerCase() != 'psd') return;

      var Path = app.activeDocument.path;

      var saveFile = File(Path + "/" + Name +".png");

      if(saveFile.exists) saveFile.remove();

      SavePNG(saveFile);

      }

      function SavePNG(saveFile){

           pngSaveOptions = new PNGSaveOptions();

      activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);

      }

       

      plz convert it to save as jpg with quality 12...