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

Saving as a .PSD and .PNG in separate locations?

$
0
0

Hi,

I've been looking for a way to save as a .PSD in one folder, and in another folder automatically save as .PNG.

I've found a script to do the .PNG part, but it saves to the same location as the .PSD. It's useful but automatically saving the .PNG to a second folder would make it perfect.

This is the script I have:

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);
}

 

Does anyone have any knowledge on if it's possible, and if so, how it could be achieved?

 

Thanks

John


Viewing all articles
Browse latest Browse all 27456

Trending Articles



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