A lot of my contacts (600+) had somehow got their birth years set to 2000. Their birth months and days are correct, but the 2000 is wrong.

With the tremendous help I got here, I was able to get them in one group (which I called 2K).

I would like to remove the birth years from those cards, while retaining birth months and days.

On my OS X 10.8.5 it can even be done manually, but not on adayzdone's 10.6.8.

Can anybody provide a script (for 10.8.5)?

So, I would like to turn

enter image description here


enter image description here

using AppleScript rather than doing it manually. And not just November 10.

  • You used this apple.stackexchange.com/questions/101692/… to fill in the 2000 in all contacts without date. So now you have 2000. That was what you wanted in first place. Now you want to remove that date again? – Ruskes Sep 13 '13 at 22:20
  • 1
    @Buscar웃 No, that script didn't fill in 2000. That script selected all contacts with a 2000 birthdate. Unfortunately, it doesn't take action on them (like removing the 2000 from the birthdate, but keeping month and day.) – Řídící Sep 14 '13 at 6:58
  • To what end do you need to do this. The date is still going to be wrong? With no year. Which may have unforeseen problems further down the line if this is the built in birthdays field. Would it not be best to move the known day and month to the notes and then remove the birthdate. Until a time when you have the correct dates – markhunte Sep 14 '13 at 13:56
  • @markhunte Well, I get Calendar alerts, which I appreciate. But I don't like many of them to state, falsely, that "tomorrow, X is having his 13th birthday" or something like it. It at looks like the year-less data is accepted. – Řídící Sep 14 '13 at 14:57
  • I accidentally put the answer on your old question. This will do what you want – markhunte Sep 14 '13 at 15:51

Ok. Since you have your group already you group.

set targetGroup to "BD" 
tell application "Contacts"
    set thePeople to people of group targetGroup
    repeat with i from 1 to number of items in thePeople
        set this_item to item i of thePeople
        set thisDate to birth date of this_item
        set year of thisDate to 1604

        set birth date of this_item to thisDate
    end repeat

end tell

I tried to set the year to "" . But it changes the whole date. day and month to something else.

So I checked what a yearless birth date 'date' looked like and they all had 1604 in the year position.

setting the year to this seems to work.

| improve this answer | |

You must log in to answer this question.

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