November 04, 2007

Recursive export to Web in Photoshop CS3

JavaScript | Photo

I use Adobe Lightroom to organize my photographs, both digital ones as well as the scanned slide films I take. Lightroom is working great for me and I've written about my disappointment with Apple Aperture in a previous entry.

Yesterday I was looking for a way to take a subset of the pictures I have and convert them to JPG. I want to use the JPGs on a small Mac Mini to make presentation in FrontRow using a newly acquired Canon SX7 digital projector (more on this in a later entry).

Unfortunately Adobe Lightroom does not offer such a functionality. You can export all the pictures in a directory to JPG, but there's no way to take a directory, and recursively export all the pictures within it to JPG while maintaining the directory structure they are in.

I could have written a small shell script to do this, but I have a mixture of TIFF, JPG and RAW images that had to be processed. I wanted to get the image processing capabilities from Lightroom or Photoshop, instead of using dcraw. Adobe Lightroom doesn't have a way to script it, so I looked at Photoshop CS3 to do it.

Photoshop can be scripted in JavaScript, in addition to AppleScript. I came up with a small script that does the conversion.

To use, download the script, install it in /Applications/Adobe Photoshop CS3/Presets/Scripts and restart Photoshop CS3.

After restart, the script is available under File -> Scripts. When you select it, the script will ask the source directory containing the images, and the destination directory where the JPG images should be placed. The script has been tested in Photoshop CS3 running on MacOS X 10.4.10. It seems to be able to process TIFF files produced by my scanner, CR2 RAW files from my 5D and the older 20D, as well as JPGs from various digital point-and-shoot cameras.

If you stop the script, the next time you restart it on the same source and destination directories, it will not process the files that have already been processed.

Note that if you process a lot of files, Photoshop ends up using a lot of the disk space on your scratch disk. I could not figure out why this happens. Quitting Photoshop seems to reclaim the scratch disk space.

The script is public domain, feel free to use and modify it as you wish. If you do end up using it and fix various bugs, please let me know so I can incorporate them in my script.

Posted by ovidiu at November 04, 2007 04:47 PM |
Post a comment

Email Address:



Remember info?

Copyright © 2002-2016 Ovidiu Predescu.