Setting a default iPhoto library for importing from a camera

Posted on March 16, 2007 by Brian Webster
Filed Under Tips & Tricks, iPhoto Library Manager |

This is a question that has come up several times from various customers. You may frequently switch back and forth between multiple iPhoto libraries, but whenever you import photos from your camera, you want them to only go into a particular library. However, when you plug in the camera, iPhoto opens up with whatever library you happened to be using last, so you have to quit iPhoto, go back and switch to the right library, then open up iPhoto again, which gets to be a pain in the butt after you’ve done it half a dozen times. So how you do get around this?

Image Capture

Lurking away in the Applications folder, often overlooked and unloved, is a little application called Image Capture. This is a general-purpose app for importing image data from various sources, such as cameras, scanners, or devices shared over the network. In the preferences window for Image Capture, there is a setting that allows you to choose what application to open up when you connect your camera.
Image Capture prefs

Typically, this is set to iPhoto, and this is why iPhoto automatically pops up when you connect your camera. But we’re going to put something else there instead…

Applescript and iPhoto Library Manager

iPhoto Library Manager supports Applescript, so you can actually write a script that will open your preferred library for you automatically. We’re going to write such a script, save it as an application, and then tell Image Capture to open the script instead of iPhoto. (note: this script requires iPLM 3.1.1 or later to work correctly)

First, open up Script Editor (located in the Applescript folder inside the main Applications folder) and copy the following script into the editor window:

tell application “iPhoto Library Manager”
open library “Default Library”
end tell

This simple script tells iPhoto Library Manager to open the library named “Default Library” from your library list. iPLM will take care of all the logic of quitting and opening iPhoto as necessary, but of course you’ll want to type in the name of whatever library it is you want to import your camera photos into. You can test the script by clicking the “Run” button, at which point iPhoto should open up, displaying the library you specified.

Now we need to save this script and tell Image Capture to use it. Press command-S to save the script, making sure to save the script as an application from the File Format pop-up menu (see the screenshot below).
Saving the Applescript

You can save it any place you want, as long as you remember where you put it. Your Documents folder might be a good place if you don’t have any better location for it.

Hooking it up

The final step is to go back to Image Capture, open the preferences window, and select “Other…” from the pop-up menu that lets you select the application to open when attaching a camera. Navigate to where you just saved the script, select it, and click “Open”.

Now, you should be all set to go. Connect your camera, and iPhoto should pop open with the library you specified. iPhoto will probably bug you, asking if you want to open iPhoto when you connect your camera, to which you can reply “No”. If you don’t want iPhoto Library Manager to stay open after it’s opened the library, just add another line reading “quit” (without the quotes) before the “end tell” line in the script.

Comments

3 Responses to “Setting a default iPhoto library for importing from a camera”

  1. Carl Berger on March 29th, 2007 8:26 am

    I’ve been waiting for this one for a long time!

    Now if there were just some way to detect the camera model and open that camera’s library. Should be able to do it read and parse Exif and have it enter in the library title.

    Ah… so much to do, so little time, so much fun!

    Thanks so much, Brian

  2. Chris Howard on April 7th, 2007 3:34 am

    Funnily, Brian, I actually changed my default camera app to iPLM. From there I chose the library I want to use. This alone makes iPLM - or any iPhoto library manager - worth having.

    As I know beforehand which library photos on my camera need to go to, I can then select the appropriate library.

  3. Henrik N on May 25th, 2008 3:11 am

    This no longer seems to work.

    Instead do:


    tell application "iPhoto Library Manager"
    open «class iLib» named "Default Library"
    end

Leave a Reply

If you have a support issue that requires a response, please e-mail support@fatcatsoftware.com





Feed