Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Find duplicate Address Book entries via a script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Find duplicate Address Book entries via a script
Authored by: doggrunner on Feb 29, '12 12:43:15PM

This works for snow leopard. I used it with LION and it aborts adding the addressbook entry (this_item to group theGroup).

It gets the following error: "error "Address Book got an error: You can only add a person to a group." number 1"
This happens on the first duplicate.
The AppleScript Error is: Address Book got an error: You can only add a person to a group.


tell application "Address Book"
exists group "Dupilicate Entries"
--> true
get name of every person
--> {"J...n"}
get every person whose name = "K..."
--> {person id "ACBABB6E-7219-41D6-9ED5-B92B65910DE7:ABPerson", person id "85E472F7-2DF4-44F8-979A-0B8EC1AF805F:ABPerson", person id "A4943471-289A-4E00-8969-4F71B569BCCF:ABPerson"}
add person id "ACBABB6E-7219-41D6-9ED5-B92B65910DE7:ABPerson" to group "Dupilicate Entries"
--> error "You can only add a person to a group." number 1
Result:
error "Address Book got an error: You can only add a person to a group." number 1



[ Reply to This | # ]