Address Book and Images

Mac OS X Address Book

There are currently 962 people in my Address Book, of which 231 of them have accompanying images. It’s very time-consuming to:

  1. Find the next entry without a photo
  2. Locate an image of the person
  3. Attach the photo to the entry

To make things go a little faster, I wrote an AppleScript that deals with step one.

property groupName : “No Image”

tell application “Address Book”
set theGroup to group named groupName

repeat with aPerson in people
try
if not image of aPerson then
end if
on error errMsg number errNum
if errNum is -2763 then add aPerson to theGroup
end try
end repeat
end tell

Make sure that you have a group named groupName before running this script. Error number -2763 occurs when the image does not exist in the person. The script then adds that entry into the selected group. As you add photos to entries, remove all the people from the group and run the script again to repopulate the group.

My next step will be to write an AppleScript that searches through my image catalog for the person’s name. That will be for another day, however.

1 thought on “Address Book and Images

  1. Roman Pixell

    useful script, thanx!

    SIDE DISH: i was stunned to see that you cant make nested smart folders in AB. awright, so i managed to get the nopic group as advised by adam, but then i dont want to take time with all the ppl in my AB, but just those that are on my cell phone (of course i have a smart group for that). now imagine i would like to “merge” the nopic group and my cell phone group by creating a third, so called “smart” group. you guessed it – its not possible to create a smart group based on two other groups. now how smart is that?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: