Scripting Dates in Address Book

I’m trying to write a script that will enter dates into Apple’s Address Book.

I figured out how to do birthdates:

make new person with properties {first name:firstNameVariable, last name:lastNameVariable, birth date:theBirthDateVariable}

But I can’t figure out how to do anniversaries. My best guess is:

make new custom date at end of custom dates with properties {label:"anniversary", value:date theAnniversaryVariable}

But it doesn’t work. Anyone know how to add a new custom date?
Thanks.

Hi,

This works for me (dates are in dd/mm/yyyy format - yours are probably different):

set BirthDate to "29/5/1979"
set AneeDate to "12/01/2001"
set AneeDate to date AneeDate
tell application "Address Book"
	make new person with properties {first name:"John", last name:"Smith", birth date:date BirthDate}
	tell person "John Smith"
		make new custom date at end of custom dates with properties {label:"anniversary", value:AneeDate}
	end tell
	save addressbook
end tell

Best

John M

Hi John…
Thanks for the help. Your code helped me to find an undetectable error in my Interface Builder app. Now everything’s working wonderfully!

my pleasure