
Then copy and paste another command into the terminal window: ioreg -Src IOUSBDevice | grep '^\+' | diff /tmp/ioreg - | Plug in your digital camera and turn it on. This command lists all the USB devices connected to your computer and stores the list in a temporary file. Copy and paste this command into the terminal window: ioreg -Src IOUSBDevice | grep '^\+' > /tmp/ioreg Keep Script Editor running, and open Terminal (in the Utilities folder inside your Applications folder). Get a list of all the USB devices connected to your computer Return (length of (do shell script check_for_device) is not equal to 0)Ģ.

Set check_for_device to "ioreg -rn " & quoted form of device_name Copy and paste this script into the editor window: on device_is_connected(device_name) Open Script Editor (in the AppleScript folder inside your Applications folder). It turns out you can do all of this using the command line and a little bit of AppleScript.


That gave me an idea: what if I could tell it to open a special application that would check to see which camera I’d plugged in? Then that application could in turn open iPhoto only if I’d plugged in my Digital Rebel. I recently stumbled across an option in Image Capture’s preferences that lets you select any application to open when a camera is connected.
