Photoshop Actions, Droplets and Scripting
Photoshop’s Actions support creating sequences of commands to be repeated. By placing prompts in the action some simple forms of input can be provided. Actions are basically good only for repeating a sequence of commands. They also support creating droplets.
A Photoshop Droplet is a small executable that supports dragging and dropping of sets of files and folders. A Droplet is always tied to a single Action. The Action is performed for each file in the drop set.
JavaScript allows nearly complete automation of the Photoshop CS application.
I was looking for a way to save all the images in a folder under the same name but with LZW Tiff compression. An Action alone couldn’t do it because the SaveAs dialog insists on binding a specific folder to the operation. A complex script could have done the job except I’d end up writing a lot of file and folder manipulation code.
The answer is to write a very simple script that saves the current document as LZW Tiff under the current documents name. Then create an action out of the script and finally a droplet out of the action.
Here’s the script:
if (app.documents.length == 0) {
alert("No active document to save.");
} else {
var doc = app.activeDocument;
var opts = new TiffSaveOptions();
opts.imageCompression = TIFFEncoding.TIFFLZW;
doc.saveAs(doc.fullName, opts);
}
Now I have a “Tif Compress.exe” droplet that I can just drag and drop a set of files and folders on which will save all the files in the set using the LZW Tiff format.