Applescript: iPhoto or Aperture?

This entry was published at least two years ago (originally posted on May 4, 2008). Since that time the information may have become outdated or my beliefs may have changed (in general, assume a more open and liberal current viewpoint). A fuller disclaimer is available.

I’m experimenting with the Aperture free trial right now for photoshoots with my D70s, but I still wanted to use iPhoto for my Casio point and shoot. Apple allows you to set either iPhoto or Aperture to automatically launch when the Finder mounts a memory card, but by choosing either one, I’d have to quit and manually launch the other application depending on which camera I was importing shots from.

However, Aperture also gives you the ability to set any application to launch when a memory card is inserted. I set up this simple little Applescript (saved as a launchable app) to be the app launched on memory card insertion:

tell application "Finder"
    if exists disk "CASIO-DSC" then
        launch application "iPhoto"
    else if exists disk "NIKON D70S" then
        launch application "Aperture"
    end if
end tell

Now, whenever a memory card is inserted, the Applescript launches, checks the volume name of the memory card (which is set by the camera when you format the card), launches the appropriate photo application, and then quits.

Pretty simple for a lot of experienced Applescripters, I’m sure, but I’m pretty happy that I got it figured out.