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: mark hunte on Oct 03, '09 09:39:45AM
I had an email from dzg, letting me know this was broken in 10.6.
As far as I can tell its an odd bug. But a simplest fix is below.


(*
REVISED FOR 10.6
Details found at - 
http://www.macosxhints.com/article.php?story=20060322202753429
Written by © Mark Hunte - 2009*)

tell application "Address Book"
	set biglist to {}
	set theGroup to "Dupilicate Entries"
	if not (exists (group "Dupilicate Entries")) then
		make new group with properties {name:"Dupilicate Entries"}
		save
	end if
	set the_names to name of people
	repeat with i from 1 to number of items in the_names
		set theName to item i of the_names
		if theName is not in biglist then
			copy theName to end of biglist
		else
			set counter to (people whose name is theName)
			if (count of counter) > 1 then
				repeat with i from 1 to number of items in counter
					set this_item to item i of counter
					add this_item to group theGroup
				end repeat
				save
			end if
		end if
	end repeat
end tell

---
mh

[ Reply to This | # ]