AppleScripting Contacts - cannot add a person to a group
AppleScripting Contacts - cannot add a person to a group
- Subject: AppleScripting Contacts - cannot add a person to a group
- From: John Mitchell <email@hidden>
- Date: Sat, 02 Jun 2018 15:20:23 +1000
HI
I’m trying to create a Group in Contacts and add persons to it.
I can create the group, but I cannot add a team of persons to the group
here are some examples of my failing code
if not (theGroupNames contains grpName) then
#create new group
make new group with properties {name:grpName}
end if
OK so far
repeat with i from 1 to teamCount
if item i of teamABPerlist is not "" then
#person exists in Contacts
set Pid to item i of teamABPerlist
set theName to (item i of cnamelist & space & item i of
surnamelist)
attempt 1
# set group of person id Pid to group id GRPid - (I can
get the group ID successfully)
attempt 2
add (person whose name is theName) to group grpName
attempt 3
# set thePerson to (person id Pid) as specifier
# set group of thePerson to group grpName
# add thePerson to group id GRPid as specifier
# save the database
save
etc
tia
John Mitchell
_______________________________________________
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