Modifying Properties in Address Book with AppleScript

I’ve been syncing my contacts and calendars with a Zimbra server as of late so that I can get synchronization with my iPhone.  While things have generally gone quite well, and most of the process has been easy, I have hit a hurdle or two, and I thought I’d write about one of them.I’ve got one machine where I’m using Thunderbird and the Zindus extension for syncing contacts with that software.  This works pretty well, but from some contacts I had synced from GMail a while back, many entries in my Address Book application had labeled email addresses as “other” rather than “work” or “home.”  Zimbra doesn’t seem to have quite the same distinction system for email addresses, and by the time things got to Thunderbird these “other” email addresses were simply getting excluded, while ones labeled “home” or “work” were still included.  Since this somewhat obviated the purpose of syncing contacts with an email client, I set about changing categories for email addresses in my address book where I only had one email address, which I was able to do with AppleScript.It’s a little rough around the edges, and if someone else where in this situation and wanted a similar fix, they might want to further restrict the set of addresses being changed to only those with an “other” email address, but this worked just fine for me.  The script follows:

tell application "Address Book"        repeat with this_person in every person                if exists (email of this_person) then                        if (count of emails of this_person) = 1 then                                set label of email of this_person to "Home"                        end if                end if        end repeatend tell
Advertisements
Posted in Uncategorized
One comment on “Modifying Properties in Address Book with AppleScript
  1. Recent Links Tagged With "addressbook" - JabberTags says:

    […] public links >> addressbook Modifying Properties in Address Book with AppleScript Saved by Superpeppi on Mon 12-1-2009 HowTo: Find orphaned Address Book entries Saved by […]

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: