Seeking script to find "orphan" contacts in Address Book

I want every contact that I enter into my Address Book (Apple supplied) to be assigned to at least one Group. I used to have a script that scanned every contact and verified that it was assigned to at least one Group, and if not, it created a new group called “Orphans” and assigned the Orphans group to the contact. That way, I could look in the Orphans group and see who needed to be assigned to some other appropriate group. I did not use this script for a long time, and it used some low level class and event stuff that I didn’t understand. Anyway, it no longer works…

Does anyone know of such a script? If not, would someone create one for me. I’ll make a PayPal contribution for the effort.

Rick

You can make a contribution at my Kagi page:

https://order.kagi.com/cgi-bin/store.cgi?storeID=ELJ#as

property orphan_group_name : "Orphan"

tell application "Address Book"
	try
		set orphan_group to group orphan_group_name
	on error
		set orphan_group to (make new group at end with properties {name:orphan_group_name})
		save addressbook
	end try
	repeat with p in (get people whose groups = {})
		add p to orphan_group
	end repeat
	save addressbook
	return name of people of orphan_group
end tell

Jon

Model: PowerBook 1.25MHz
AppleScript: 1.10
Browser: Safari 412
Operating System: Mac OS X (10.4)

Works perfectly. Thanks. You’ll see a contribution for your effort.

Browser: Safari 412
Operating System: Mac OS X (10.4)