I recently upgraded from 10.6.8 to 10.11.3.
I'm studying "Contacts" and trying to add a person to an existing group, but my many variations (some from this list) all get the same error with both Script Editor V2.8.1 and Smile V3.8.0:
tell application "Contacts"
set theJasons to people whose name begins with "Jason"
log "#Jasons = " & (count of theJasons)
set somePerson to item 1 of theJasons
log "class of somePerson = " & class of somePerson
set SomePersonsID to the id of somePerson
log "id of somePerson = " & SomePersonsID
log "groups of somePerson = "
log groups of somePerson as list
log "name of groups of somePerson = "
log name of groups of somePerson as list
set theKnownGroup to the group "Known"
log "# in theKnownGroup = " & (count (theKnownGroup))
log "class of theKnownGroup = " & class of theKnownGroup
set theKnownGroupsID to id of theKnownGroup
log "id of theKnownGroup = " & theKnownGroupsID
-- All of these got the same error message:
-- add somePerson to group id theKnownGroupsID
-- add person id SomePersonsID to group id theKnownGroupsID
-- add somePerson to theKnownGroup
add person id SomePersonsID to theKnownGroup
end tell
-->
(*#Jasons = 4*)
(*class of somePerson = person*)
(*id of somePerson = 142EF1DB-DDDB-45A3-A1B0-936358820D84:ABPerson*)
(*groups of somePerson = *)
(*group id 439805FD-3684-408F-85F9-5AB9A9A7706D:ABGroup*)
(*name of groups of somePerson = *)
(*card*)
(*# in theKnownGroup = 1*)
(*class of theKnownGroup = group*)
(*id of theKnownGroup = 32E8FDCB-2D91-4DA8-9A35-095A33F6EACD:ABGroup*)
Result:
error "Contacts got an error: You can only add a person to a group." number 1
I'd appreciate any ideas what else to try..
--Gil