AppleScript for Digital Photographers

January 24, 2005 by Ben Long
Filed under: Features 
One of the great advantages of shooting digital is the ability to shoot and shoot and shoot without having to pay for all that film and processing. The downside is that your image workflow can quickly be overwhelmed by a glut of images. Mac users have a tremendous workflow ally in the form of AppleScript. Over the next few months, we’re going to be spending a lot of time looking at workflow automation. In this first article we delve into Mac OS X’s Image Events.

AppleScript is one of those Mac technologies (like Target Disk Mode) that Apple doesn’t hype enough. I’m often surprised at how even many long-time Mac users seem to have little understanding or hands-on experience with AppleScript.

This article will give you a quick overview of what AppleScript does, and how it works. In addition, it will introduce you to Image Events, the suite of image processing routines that’s built-in to every copy of OS X 10.3. Though you can’t see it in the Finder, Image Events is an application that’s installed with the OS. It lacks any kind of interface or I/O capability, but it’s fully AppleScriptable.

In future postings, we’ll be delving into how you can use Image Events to improve your digital photography workflow. In the meantime, here are some simple little AppleScripts that can ease some of your digital photography woes. Each of these uses Image Events for its graphics processing, which means you don’t have to have any other software installed or running. Everything you need to run these scripts is built-in to the OS.

Note: Because the scripts are all based on Image Events, they only work with Image Events-supported graphics formats: JPEG, JPEG2, TIFF, GIF, Photoshop, PICT, BMP and PNG.

Another Note: AppleScripts that appear as "Droplets" don’t do anything, and sometimes crash, if you simply double-click on them to run them. To launch them, you need to drop compatible files on top of them.

Resize and Mail

Drop image files on this app and they will automatically be resized to 640 x 480 and attached to a new message in Apple’s Mail program. If you use a different mail program, lemme know and I’ll see about posting modified versions for other apps. Click to download.

Resize, Rotate 90, and Mail

Does the same as Resize and Mail, but rotates the image 90° clockwise. Click to download.

Photo Renamer

Digital cameras, of course, produce images with fairly useless, gibberishy file names. This droplet will automatically rename images based on the name of the folder that encloses them. So, drop a folder of images onto Photo Renamer, and each image will be renamed as <Name of Folder> <Date of image creation> <index number>.<original file extension>. This script doesn’t work if you drop individual files on it. Click to download.

Lock all JPEGs

If you like to think of your original JPEG files as "negatives" then it’s a good idea to lock your files so that you don’t accidentally save over them. Drop a folder of images on this droplet and any included JPEG files will automatically be locked. Also includes an Unlock droplet for…well, you get the idea. Click to download.

PictureMunger

This stand-alone application provides an overview of all of the commands supplied by Image Events. Drag and drop any number of image files onto the application, and you can batch process them according to the specs you configure in the program’s main dialog box (see below).

Sorry, this version won’t process folders. You have to drop image files. Click to download.

include(‘./adInsert.html’);





Comments

10 Comments on AppleScript for Digital Photographers

  1. Gwendolyn DeFortuna on Tue, 15th Feb 2005 12:10 pm
  2. Resize, Rotate 90 and Mail is the coolest! Does just exactly what usually takes hours and Photoshop to do (if you count setting everything up, launching programs, finding files, resizing, saving as jpegs, resolving attachments). Finally sent my friends the birthday pictures I’d been meaning to send for weeks. If your pics don’t need a lot of adjustment, this is perfect. A great anti-procrastination tool—no reason to delay the chore any more, it’s painless!!

  3. gilles on Sat, 5th Mar 2005 11:29 am
  4. PictureMunger is a great tool, i was looking for something that simple and not part of a complex software solution.
    Thanks, great scripts !!
    gg

  5. Ben Long on Sun, 6th Mar 2005 9:10 pm
  6. Thanks GG! Feedback (especially positive) is always appreciated. With the release of Tiger in a few months (crossing fingers) Image Events should get a number of new features. This should allow us to do lots more of these Munging kind of effects.

  7. Kevin Meaney on Thu, 10th Mar 2005 11:11 am
  8. I’m not too sure about how many extra features Image Events might add when Tiger is released, but iMagine Photo which is free is an applescriptable tool like Image Events designed to process image files, but with a much larger range of functionality. It can run on Jaguar, Panther and I believe it will have no problem in Tiger as well. See http://www.yvs.eu.com/documentation/ for further info and lots of example scripts.

    Kevin

  9. Francois Couderc on Tue, 5th Jul 2005 4:08 pm
  10. Mail & resize does it well!!! thank you Ben. What about making a folder on the desktop where the pictures could be instead of the desktop itself? I can imagine something like “tell finder create folder”… just joking you know better! Thanks again for a great utility.

  11. Chris Malatesta on Thu, 7th Jul 2005 8:03 am
  12. I love the photo renameing script, although it seems to stop on errors that I can’t figure out why, I thought it was because the images were duplicates at first, then figured out it has to be something else, do you have any idea what causes this? The error is “Can’t make month of < > blah blah class ascd missing value classs asmo date….. Any help would be appreciated. I used to write windows software, but haven’t even started looking at AppleScript, although I love my mac.

    Thanks!

  13. 12GAGE on Tue, 15th Nov 2005 5:57 pm
  14. I’m trying to find a script that will open my PDF’s in Photoshop CS at a specific resolution. How do I do this?

    [...] Buy a copy of Photoshop Elements for the Mac at Amazon.com. Need to upgrade to Tiger? Order it now from Amazon.com. Related Links: Other photo-related Automator Actions AppleScript for Digital Photographers Taking Action with Photoshop Actions Adobe Illustrator Automator Action For more on Automator, check out: Automator.US automatorworld.com [...]

  15. Joe R. on Sun, 12th Nov 2006 10:26 am
  16. I want to tell you how much I love PictureMunger! It is fast and easy. I am pretty sure that you use PictureMunger to access Apple’s Image Events (which uses sids, correct?). I have been trying the new JPEG 2000 format. When I resized and saved an image as JPEG2 (which I assume is JPEG 2000) using PictureMunger, the file was saved with a .JPEG2 extension. My copy of Mac OS 10.4 didn’t associate any program with that extension. Using [Get Info --> Open with: --> Preview] helped it figure out what program to use, but I thought it should be saving the file as .jp2, not JPEG2, correct?

    Just for kicks I opened an image in Preview and chose the Save As option. Under Formats it was JPEG-2000 and then a little slide bar for Quality (Least to Lossless, w/an Alpha radio box). Once saved, the file showed up on the desktop with the appropriate .jp2 extension. Is there any way that PictureMunger could do this? I wasn’t sure whether the current setup was purposeful or not. It would be awesome to pick that image quality setting in PictureMunger too!

    In closing, I guess this has been a praise for your program, a possible bug report (.JPEG2 extension, instead of .jp2), and feature request (Save As .jp2 and quality slidebar). My wife just had a baby girl and we have been taking lots of photos that need to be scaled and web optimized. Your little program rocks for such a thing! Thanks again Ben!

    Regards, Joe Rodgers

    [...] If you’d like to know more about Automator, check out Apple’s Automator pages. Buy a copy of Photoshop CS 2 for the Mac at Amazon.com. Need to upgrade to Tiger? Order it now from Amazon.com. Related Links: Other photo-related Automator Actions AppleScript for Digital Photographers Taking Action with Photoshop Actions Adobe Illustrator Automator Action For more on Automator, check out: Automator.US automatorworld.com [...]

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!





  • Nothing Else to Buy!



    Fifth Edition
    Order Now!

    Complete Digital Photography
    by Ben Long.

    Everything you want and need to know about digital photo-
    graphy - from buying a camera, to editing your images, to making your final prints. Completely reorgan-
    ized and loaded with more content than any previous edition!



  • Shoot better landscapes

    Lynda.com
    DVD Video

    CS5 Landscape Photography
    by Ben Long.

    Seven hours of video instruction on all aspects of landscape photography from gear to shooting to post-production. Learn the aesthetics and practices of serious landscape work as you master tone, color, HDR, panoramas, and more.



  • More To Read

    Real World
    Capture NX2


    Real World Capture NX

    Order Now!

    by Ben Long.

    Learn the ins and outs of Nikon's exceptional image editing application. Capture NX 2 provides revolutionary selective editing tools, and a fully non-destructive image editing environment that can be used on any TIFF, JPEG file or Nikon raw file.

    Click here for more info!