Removing a field from Contacts/Address Book
Removing a field from Contacts/Address Book
- Subject: Removing a field from Contacts/Address Book
- From: David Morrison <email@hidden>
- Date: Sun, 25 Nov 2012 12:33:20 +1100
I've been updating my Contacts, and imported a list of birthdays.
Unfortunately, in the course of all the manoeuvering to get this to
work, I inadvertently imported them all into a field called Date
(other).
Now the Contacts application is absolutely useless for almost
everything, and it is especially useless for dealing with an issue
like this. There seems to be no way to edit anything for more than
one card. So it looked like I would have to go through each of the
500 contacts and remove the field manually.
AppleScript to the rescue! This is my test script to just delete it
from the card of the user selected in the Contacts window. "Date
(other)" turns out to be a "custom date" object.
tell application "Contacts"
set thePeople to selection
set personProperties to properties of custom date of (item 1
of thePeople)
remove custom date from (item 1 of thePeople)
set personProperties to properties of custom dates of (item 1
of thePeople)
end tell
When I run it, I get:
AppleScript Error
Contacts got an error: Can't make custom date into type entry.
This is the event Log:
tell application "Contacts"
get selection
--> {person id "FBAEC9D2-8956-4B21-B63A-DF4F103F16C8:ABPerson"}
get properties of custom date of person id
"FBAEC9D2-8956-4B21-B63A-DF4F103F16C8:ABPerson"
--> {{label:"other", value:date "Thursday, 26
December 1901 12:00:00 ", class:custom date,
id:"7E944FE3-EB79-4791-99C4-573C5C7C0E0F"}}
remove custom date from person id
"FBAEC9D2-8956-4B21-B63A-DF4F103F16C8:ABPerson"
--> error number -1700 from custom date to entry
Result:
error "Contacts got an error: Can't make custom date into type
entry." number -1700 from custom date to entry
I feel that it is just a case of getting the syntax right, but I
cannot see what it should be. Or maybe I could just set the field to
be empty?
This is on OS X 10.8.2.
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden