UPDATE: As the first comment below indicates, one can now do this natively in iPhoto. A little Googling suggests that Apple added this feature in iPhoto 4. So check out the Batch Change feature (found in the Photos menu), it appears to do the same thing that my Applescript does. Actually, it does one thing my script can’t do — it is able to replace comments entirely, if you want, instead of appending to the existing comment.
Thanks to Michael Browne for pointing this out.
(Original post follows…)
I use iPhoto to manage my digital photo collection, but I find its keyword feature to be very difficult to deal with. I wanted a free-format searchable keyword system, not some predefined list of tags I could add to my pictures.
iPhoto has a comment facility so you can put remarks on your images. However, you can only do so one image at a time using a text entry box. When I have a newly imported batch of 200 photos and want to apply the same keyword(s) to all of them, that just isn’t going to work.
Enter Applescript. This script will let you add a random string of word(s) to any selection of images in iPhoto. Simply select the desired photos in your current iPhoto window, run this script, enter your keyword(s) in the dialog box and click OK. The script will run and pop up another dialog when it’s finished.
The script will recognize existing comments and preserve them. If an image has no comment, the keyword(s) are set as the comment. If an image already has a comment, the keyword(s) are appended after adding a space.
Now, I can go to iPhoto, type “hubbard glacier” into my search box, and find all the pictures I took of a particular glacier in Alaska. Voila! And I don’t have a zillion pre-defined keywords in the iPhoto preferences, either.
One final note. If you apply your keyword(s) to a lot of images, it might take a while to get back the final OK window. Don’t worry, Applescript is still working for you. Be patient. On my PowerBook G4 1.25GHz laptop, it can take a couple of minutes to get the result back if I’m marking 200 photos.
DISCLAIMER: Use this software at your own risk. If it does something bad to your iPhoto database, it’s not my fault.
NOTICE: I have used this script with iPhoto 5 and can claim it will work. It has not been tested with iPhoto 6 to my knowledge. If you decide to try it with iPhoto 6, please drop me a note and let me know what happened.
Download iphoto_batch_add_comments.zip