• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adding a person to a group in Contacts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding a person to a group in Contacts


  • Subject: Adding a person to a group in Contacts
  • From: Gil Dawson <email@hidden>
  • Date: Sat, 27 Feb 2016 12:45:58 -0800

Hi--

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:

"Contacts got an error: You can only add a person to a group." number 1

Here's my script:

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
 _______________________________________________
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

  • Follow-Ups:
    • Re: Adding a person to a group in Contacts
      • From: Andrew Oliver <email@hidden>
  • Prev by Date: Re: How to Paste into Outlook 2011 using keystorkes/System Events
  • Next by Date: Telling iCloud from OnMyMac in Contacts
  • Previous by thread: Fwd: Cannot get Java script to work with Acrobat DC
  • Next by thread: Re: Adding a person to a group in Contacts
  • Index(es):
    • Date
    • Thread