Hi there... I have a script I can run that will save a PNG of the current visiable layers, and then increment the file name. I use this script inside actions to allow me ot save out files during edits. This is my current script. var saveFolder = new Folder( "d:\\PathTo\\SaveFolder" );
var saveExt = 'png';
var saveSufixStart = '_';
var saveSufixLength = 3;
// End of user options
//==========================================
var docName = decodeURI ( activeDocument.name );
docName = docName.match( /(.*)(\.[^\.]+)/ ) ? docName = docName.match( /(.*)(\.[^\.]+)/ ) : docName = [ docName, docName, undefined ];
var saveName = docName[ 1 ]; // activeDocument name with out ext
var files = saveFolder.getFiles( saveName + '*.' + saveExt );// get an array of files matching doc name prefix
var saveNumber = files.length + 1;
//alert("New file number: " + zeroPad( saveNumber, saveSufixLength ));
var saveFile = new File( saveFolder + '/' + saveName + '_' + zeroPad( saveNumber, saveSufixLength ) + '.' + saveExt );
sfwPNG24( saveFile, 80 );
//activeDocument.saveAs( saveFile, jpgSaveOptions ,true ,Extension.LOWERCASE);
function zeroPad ( num, digit ) {
var tmp = num.toString();
while (tmp.length < digit) { tmp = "0" + tmp;}
return tmp;
}
function sfwPNG24( saveFile, quality ) {
var pngOpts = new ExportOptionsSaveForWeb;
pngOpts.format = SaveDocumentType.PNG;
pngOpts.PNG8 = false;
pngOpts.transparency = true;
pngOpts.interlaced = false;
pngOpts.quality = quality;
activeDocument.exportDocument( new File( saveFile ), ExportType.SAVEFORWEB ,pngOpts);
} I had this made for me as I have zero understanding about scripting and programming.. I think the problem is the "ExportType.SAVEFORWEB"? Basically if I have 800DPI image 2119x2883 pix 6.73x9.15cm I want it to stay that way... at the moment the script is outputting this... 72DPI 2119x2883 pix 74.75x101.71cm How would I midify this script to retain the existing DPI and print size of a document? Thank you for any help you may have.
... View more