Monday, July 21, 2008

Script to update EXIF data in iPhoto '08


I shoot some photos with a digital Nikon D50, and some with a Leica M3 (35mm film). The pictures from the digital Nikon are encoded with plenty of detail in the EXIF tags, but the digitized images from the Leica and the 35mm film have only a few tags from the scanner.

I wanted a script that would update the desired EXIF tags direct in iPhoto. I looked around on the Internet at other scripts, and wrote a simple script to update a few EXIF tags on selected images in iPhoto.

I won't go into a full set of instructions here, but in summary these are simplified directions:

  1. Download and install the EXIFTool, which is a platform-independent Perl library.
  2. Enable GUI Scripting for AppleScript. In Finder, navigate to Applications -> AppleScript -> AppleScript Utility.
  3. Start Script Editor. In Finder, navigate to Application -> AppleScript -> Script Editor. Copy the code below into Script Editor, compile it to verify no errors, edit as desired for your camera make and model (or other EXIF tags), and save for future use.

-- original script written by Peter Samson
global iPhotoVersion, selectedPhotos
tell application "iPhoto" to set iPhotoVersion to (character 1 of (version as text)) as integer -- get iPhoto version
if iPhotoVersion < 7 then
error "This script requires iPhoto '08 (version 7.x) or later."
else
tell application "iPhoto"
set photoList to selection
set selectedPhotos to (count photoList)
if class of item 1 of photoList is album or selectedPhotos < 1 then
error "You must select one or more photos. This script will intentionally not process an album."
else
repeat with i from 1 to selectedPhotos
set this_photo to item i of photoList
tell this_photo
set image_file to the image path
end tell
set output to do shell script "exiftool -Make='Leica' -Model='M3' " & "'" & image_file & "'"
end repeat
end if
end tell
end if

The script looks ugly here but don't worry - it will be formatted and pretty when you compile it in Script Editor.

The script above will set two EXIF tags - set the Make to Leica and set the Model to M3. There are numerous EXIF tags available for use.

Now, using the script. Keep the script open in Script Editor. Open iPhoto '08 and select/highlight ONLY ONE(!) image as a test. The script is designed to alter the EXIF tag(s) for the image(s) that are selected in iPhoto. Go back to Script Editor and run the script - it should update the EXIF tag(s) for the selected image in iPhoto. Go back to iPhoto and look at the EXIF tag(s) for the selected image. Done!

Sunday, July 6, 2008

WALL-E and Mac envy?


First, Pixar's WALL-E is a great movie for all ages.

Second, there are easter eggs throughout the film.

It got me thinking. Is it really a larger shot at Microsoft? Is EVE representative of Apple, and WALL-E representative of Microsoft? EVE is sleek and sumptuous. WALL-E is a relic and limited in function. WALL-E covets EVE and eventually isn't shy about it.

Friday, July 4, 2008

Walt Mossberg's tips for switching from Windows to Mac


Walt Mossberg writes the Personal Technology column for the Wall Street Journal (WSJ), and he has a great article on Tips for switching from Windows to Mac.

The article discusses items such as Menu Bar, Dock, System Preferences, keyboard shortcuts, and so on.