4

Years ago when I got my first iPhone, AT&T transferred all of the contacts from my old phone. My old phone didn't have a birthday field in the contacts. Instead of leaving the field empty on the iPhone, AT&T's system set them all to Jan 1, 2000.

Is there a way to update these with a script? Export them to a CSV, find-and-replace, and reimport?

Update - This is what my Contacts app looks like. The middle section is an Exchange server, which contains Contacts. However, those contacts appear unrelated to Exchange. The Exchange directory is the "All Work" group above it, and the "Work Global Address List" below.

My Contacts

Using AppleScript, "Address Book" is automatically changed to "Contacts" and only those 3 contacts from the Contacts subgroup above are selected:

tell application "Address Book"`
  set thePeople to every person
    repeat with thePerson in thePeople
      return the name of thePerson
  end repeat
end tell

1 Answer 1

1

If you want to just clear the birthday field programmatically, you could do that on a Mac that syncs contacts with the iPhone (either via iCloud or iTunes).

Open up AppleScript editor, paste in the following and hit run to clear every birthday in your address book.

tell application "Address Book"
    set thePeople to every person
    repeat with thePerson in thePeople
        set the birth date of thePerson to missing value
    end repeat
    save
end tell

If you have the birthday data already in some other format and are looking to import it, that could be done, but would be a bit trickier. You'd probably need to get the AppleScript to look up the birthday for a given person from a file. If you need something like that, please edit your question to be more specific and give some sample data if possible.

1
  • When I type "Address Book" and Compile, AppleScript Editor changes it to "Contacts." I temporarily changed the repeat code to use return the name of thePerson and it only returns the few people in the Contacts group, which is one of several groups under All Contacts and doesn't include iCloud. I can't seem to figure out how to include them in this script.
    – wst
    Dec 13, 2012 at 15:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .