Sub topic 10
Grouping contacts with groups and smart groups
This chapter assumes you can add and edit contact cards in Contacts and that at least one account is set up in Internet Accounts settings. It covers two ways to collect cards: groups you fill by hand, and smart groups that fill themselves from rules.
Groups: lists you maintain
A group is a named list of contact cards. A card can belong to several groups. Removing a card from a group does not delete the card.
To create a group:
- In Contacts, choose File > New Group.
- Type a name and press Return.
- Select All Contacts, then drag cards onto the group name in the sidebar.
If the sidebar is hidden, choose View > Show Groups.
Each group lives in one account. A group made under iCloud syncs to your other devices. A group made under "On My Mac" stays on this Mac. Create the group in the account that holds the cards you want in it.
You can email a whole group. Control-click the group and choose Send Email to "Group Name". Mail opens a new message addressed to every member who has an email address.
Smart groups: lists that update themselves
A smart group is a saved search. You write rules, and Contacts shows every card that matches. When you add or edit a card, membership updates without any dragging.
To create one, choose File > New Smart Group. Name it, then set one or more rules. For example:
- Company contains "Example Corp"
- Birthday is in the next 30 days
- Email contains "@example.com"
Use the pop-up menu to require all rules or any rule. Select "Update the group live" behavior by simply leaving the smart group in place. It always reflects the current cards.
Choosing between them
| Need | Use |
|---|---|
| A hand-picked list, such as wedding guests | Group |
| People who share a trait, such as a company or email domain | Smart group |
| A list that should sync to other devices | Group in an iCloud account |
| A list that stays current as cards change | Smart group |
Common errors
- A card is missing from a smart group. Check that the card actually contains the field you test. A rule on Company finds nothing if the Company field is empty.
- A group is missing on your iPhone. The group probably sits under "On My Mac". Move the cards into a group under iCloud.
- Emailing a group skips someone. That card has no email address.
- A smart group does not appear on other devices. Smart groups are created and kept on the Mac. Do not rely on them elsewhere.
Checking from the shell
Because groups are visible to scripting, you can list them. This read-only AppleScript returns the group names:
tell application "Contacts"
get name of every group
end tellThe first run may prompt you to allow your terminal or Script Editor to control Contacts. Approve it in the dialog, or in System Settings > Privacy & Security > Automation.
Exercise
You want a list of everyone whose email ends in "@example.com" that stays correct as you add new contacts. Should you use a group or a smart group, and why?
Show answer
Use a smart group with the rule "Email contains @example.com". It re-checks every card, so new contacts with that domain appear automatically. A normal group would need you to drag each new card in by hand.
Exercise
A group you created appears in Contacts on your Mac but not on your iPhone, which uses the same iCloud account. What is the most likely cause?
Show answer
The group was created under "On My Mac" instead of under iCloud, so it never syncs. Create the group under iCloud and add the cards to it.