Outstreched arm

Wednesday, June 06, 2007

Find Address Book contacts without pictures

My post about cleaning up and prettying up your OS X Address Book in preparation for iPhone sparked the following question: is there a way to create a Smart Group of contacts who don't have pictures?

Not a Smart Group, no - but here's a quick bit of AppleScript to do the same:

tell application "Address Book"

 set theGroup to make new group with properties {name:"No Pictures"}

 repeat with x from 1 to the count of people
  set thePerson to person x
  if not (the image of thePerson exists) then
   add thePerson to theGroup
  end if
 end repeat

 save addressbook

end tell


P.S. Of course, since this is not a Smart Group, you'll have to remove people from it as you add their pictures. Actually, just delete the whole group and start over whenever you run this - otherwise you'll have multiple "No Pictures" groups.

There are 0 Comments:

Post a Comment