Now that I've been shooting film I've been doing more and more scanning of negatives. It takes a long time with my scanner (10 minutes for a black and white frame and 15 minutes for a color frame, yes, a single frame of film).
The other pain is taking all the scanned frames and saving them as TIFF files. I was unable to find a good SaveAll function for Photoshop. So I decided to bust out the Adobe Photoshop scripting guides and write a save all function.
This script opens a dialog box and asks you to select a destination. It then checks the folder for tiff files and gets a count of tiff files. It uses the count of tiff files to find the starting number for numbering the files in the folder. Files are names in the form: ScanXXXX.tif or Scan0001.tif.
After all the open documents are saved new contact sheets are created fro the directory using the Photoshop contact sheet function. These contact sheets contain all the tiff files in the directory. The contact sheets are named: ContactSheetXX.jpg or ContactSheet01.jpg
This script is designed to run over and over on the same directory so that you can scan and save and scan and save. Each time you run the script to save the files the contact sheets are regenerated, however, the previous tiff files are unaffected.
Scirpt is in extended for viewing... File available here: SaveAllTiff.jsx
To run script on either Windows or Mac (I tested both along with CS2 and CS3) choose browse in the script submenu of the file menu and select the script file from your file system. It will pop up a dialog asking you where to put the files. Select the folder and wait for it to complete.
// // 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 http://www.gnu.org/licenses/. //Posted by pqbon at August 8, 2007 1:59 AM// 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 = startDisplayDialogsfunction 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)
}
Thanks a lot for sharing ! Your solution solved my problems :)
Posted by: michax at March 25, 2008 5:20 AM