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

Find all non-grouped contacts in Address Book Apps
In Address Book, as you probably already know, a simple way to find which groups a contact belongs to is to select the contact and hold down the Alt/Option key. The groups will then highlight in the list.

For those who like to have their contacts at least in one group (useful for Mail rules, for example), here's a script to create a new group containing only ungrouped contacts:
property orphan : "Orphans"
tell application "Address Book"
  try
    if group orphan exists then
      repeat with this_person in every person of group orphan
        remove this_person from group orphan
      end repeat
    else
      make new group at the end of groups with properties {name:orphan}
    end if
    save addressbook
    repeat with this_person in every person
      if number of groups of this_person = 0 then
        add this_person to group orphan
      end if
    end repeat
    save addressbook
  end try
end tell
[robg adds: I tried this, and it works as expected. And thanks to Doug Adams of Doug's AppleScripts for iTunes, as he helped me figure out why the submitted script wouldn't run as is (a simple missing statement, but I was too blind to see it!).]
    •    
  • Currently 2.43 / 5
  You rated: 2 / 5 (7 votes cast)
 
[17,528 views]  

Find all non-grouped contacts in Address Book | 6 comments | Create New Account
Click here to return to the 'Find all non-grouped contacts in Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Find all non-grouped contacts in Address Book
Authored by: earthsaver on Dec 07, '05 07:56:24AM

I've been feeling the need to put every contact in a group, but I don't have time to go through my entire address book manually with option to figure it out. I'm so happy to find this hint today!

---
- Ben Rosenthal
Q16 1.25 - Tiger



[ Reply to This | # ]
Find all non-grouped contacts in Address Book
Authored by: sjk on Dec 08, '05 03:02:26PM

I didn't know about that option key trick (there sure are plenty of 'em) in Address Book so thanks for that tip. Since migrating to Apple Mail from Mulberry (my long-time favorite IMAP client whose company filed for bankruptcy) I've been started using Address Book more often and paying attention to related hints here. My primary contact list is still on my Palm PDA, awaiting a synchronization with Address Book via Missing Sync once I have enough time for the tedious post-sync task of finding/fixing any "mistransferred" entries (which I'm sure there will be).



[ Reply to This | # ]
Find all non-grouped contacts in Address Book
Authored by: taxi on Dec 08, '05 10:40:15PM

Watch out for one of the new 'features' of Missing Sync.

It handles groups from Address Book, but really only can handle each Address Book entry being in one group.

This is pretty crap, but you can live with it - I've had to change to using Smart Groups and special additions to the Notes section.



[ Reply to This | # ]
Find all non-grouped contacts in Address Book
Authored by: fogboy on Oct 24, '11 01:38:28PM

I used this wonderful little script all the time. Now on Lion (at least for sure 10.7.2) it no longer works. Creates the "Orphans" group, but does not populate it with any contacts who (I've confirmed) are not in a group.

I've read through the script pretty carefully and I can't seem to spot what piece would no longer working. Please help!

Thanks



[ Reply to This | # ]
Find all non-grouped contacts in Address Book
Authored by: fogboy on Nov 15, '11 12:44:16PM

Correction -- in lion, one can make a smart group with the paramaters being that the card "is not a member of" and then select "any group" -- HOWEVER this does NOT work if all your contacts are icloud. only if they are on your mac. that's as per the troubleshooting session i just had with a senior advisor. even though this is "expected behavior" they are treating it like a bug and will hopefully fix the problem soon.



[ Reply to This | # ]
Find all non-grouped contacts in Address Book
Authored by: emaven on Sep 29, '12 01:35:59AM

I just discovered a much easier way to do this in Mountain Lion. Just use a smart group. Card is not a member of any group. This produces a list of those cards that are not in any group.



[ Reply to This | # ]