// // Copyleft 2007 - Will Deutsch // // Copyright (C) 2007 - Will Deutsch - wdeutsch@pqbon.com // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // Save the current preferences var startDisplayDialogs = app.displayDialogs // Set Adobe PhotoshopCS3 to use pixels and display no dialogs app.displayDialogs = DialogModes.NO // ask the user for the folder var FPath = Folder.selectDialog("Save files to") ; var fileList = FPath.getFiles("*.tif"); var Start = fileList.length; for(var i = 0; i < documents.length; i++){ app.activeDocument = documents[i]; var fName = FPath + "/Scan" + PNumber(Start + i,4) + ".tif"; var tiffSaveOptions = new TiffSaveOptions; tiffSaveOptions.alphaChannels = false; tiffSaveOptions.annotations = false; tiffSaveOptions.byteOrder = ByteOrder.IBM; tiffSaveOptions.embedColorProfile = true; tiffSaveOptions.imageContression = TIFFEncoding.TIFFZIP; tiffSaveOptions.interleaveChannels = true; tiffSaveOptions.transparency = false; tiffSaveOptions.layers = false; var sFile = new File(fName); activeDocument.saveAs( sFile, tiffSaveOptions, false, Extension.LOWERCASE); } while(documents.length > 0){ var CloseDoc = documents[0]; CloseDoc.close(SaveOptions.DONOTSAVECHANGES); } var CtSheet = new ContactSheetOptions; var fileList = FPath.getFiles("*.tif"); makeContactSheet(fileList, CtSheet); jpgSaveOptions = new JPEGSaveOptions(); jpgSaveOptions.embedColorProfile = true; jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE; jpgSaveOptions.matte = MatteType.NONE; jpgSaveOptions.quality = 12; for(var i = 0; i < documents.length; i++){ app.activeDocument = documents[i]; ctxFile = new File(FPath + "/ContactSheet" + PNumber(i, 2) + ".jpg"); activeDocument.saveAs(ctxFile, jpgSaveOptions, false, Extension.LOWERCASE); } while(documents.length > 0){ var CloseDoc = documents[0]; CloseDoc.close(SaveOptions.DONOTSAVECHANGES); } // Reset the application preferences app.displayDialogs = startDisplayDialogs function PNumber(num, prec){ var RetString; var t1 = 1; var t2 = 0; var s1 = ""; for(var i = 0; i < prec; i++){ t1 *= 10; } t2 = t1 + num; s1 = t2.toString(); RetString = s1.substr(1, prec); return(RetString) }