Fat Cat Software

Setting a default iPhoto library for importing from a camera

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 CaptureLurking 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.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 ManageriPhoto 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 tellThis 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).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 upThe 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.