Deleting Anniversay and Birthday fields from Address Book contacts

Hi,
I’m a AS newbie and somewhat stumped.

I have a sync problem that sets dates for Birthday and Anniversary to weird years like 0002. These values cause Missing Sync to abend when syncing to my mobile phone.

Does anyone have a script that will simply scann all contacts and delete/zero specific fields ? I found a few that work on text fields using set as “” but this won’t work with date fields.

Any help gratefully appreciated!

Paul

I would of expected something like this to work


tell application "Address Book"
	set thePeople to selection
	repeat with p in thePeople
		remove birth date from p
	end repeat
end tell

But birthdate isn’t an entity like email address it’s only a propery.

i couldn’t even do

set birth date of p to null

Someone else may be able to help

Thanks!

I’ve managed to get the Birth Date deleting, the custom date “Anniversary” is still beating me.

Paul

How did you get it to delete ? , please post.

the custom date can be access like this

tell application "Address Book"
	set thePeople to selection
	repeat with p in thePeople
		repeat with a in custom date of p
			
		end repeat
	end repeat
end tell

Kim,
this kills the Birth Date

tell application “Address Book”
set mylist to selection

repeat with this_person in mylist
	delete birth date of this_person
	
end repeat

save addressbook

end tell