I'm trying to use applescript to clean up various problems a large address book, to large to fix by hand. I've been able to find and observe contacts and groups in AppleScript successfully. However, any sort of modifications I make to any property of a contact do not persist, even after calling Application save. For instance, this script to change the first name of my first contact:
tell application "Contacts"
set thePerson to (item 1 of people)
log (get name of thePerson)
set first name of thePerson to "JustTesting"
if unsaved then
log "unsaved"
else
log "not unsaved"
end if
save
log (get first name of thePerson)
return thePerson
end tell
This script doesn't work - it does not modify my first contact, and also logs "not unsaved".
I am using 10.8.3 Mountain Lion. What am I doing wrong here?
(I've asked a similar question on SO here: https://stackoverflow.com/questions/17140148/how-to-modify-an-abperson-instance-using-pyobjc , on how to do this with PyObjC)