Sub topic 1
How Mail, Calendar, and Contacts fit together
Prerequisites
This chapter assumes you can move around macOS (Finder, System Settings, the menu bar). It also assumes you have at least one email address and know what an Apple Account (formerly Apple ID) is. You don't need any prior knowledge of mail protocols or calendar formats.
Three apps, one source of data
Mail, Calendar, and Contacts look like separate programs, but they work as front ends over the same thing: your accounts. An account is a connection to a server that stores your messages, events, and people. The apps display and edit that data. They don't own it.
One account can supply all three kinds of data. An iCloud account, for example, can provide mail, calendars, and contacts. An Exchange account from an employer can do the same. A simple IMAP email account usually supplies mail only.
This model explains most behavior you will see later. If you delete an event in Calendar, you are asking the account's server to delete it. If an account is turned off, its data disappears from the app, but it is not deleted from the server.
How the apps connect to each other
The apps share information in a few predictable ways:
- Mail and Contacts. When you type a name in a message's To field, Mail looks it up in Contacts. Saving a sender to Contacts from a message adds a card.
- Mail and Calendar. An email that contains an invitation shows an accept or decline control in Mail. Your reply goes out by email, and the event appears in Calendar.
- Calendar and Contacts. Inviting someone to an event uses their contact card, and a birthday on a card can appear on a Birthdays calendar.
A later chapter covers these links in detail. For now, remember that they depend on the accounts being set up correctly.
Where to see and change accounts
Accounts are managed in one place: System Settings, under Internet Accounts. Each account there has switches for the kinds of data it provides, such as Mail, Calendars, and Contacts. Turning a switch off hides that data type from the matching app.
The apps also show which account owns each item:
| App | Where the account appears |
|---|---|
| Mailbox sidebar, grouped by account | |
| Calendar | Calendar list, grouped by account |
| Contacts | Group list on the left, with one section per account |
A first check that everything works
You can confirm that each app is reachable from a script. These read-only commands only list names. Run them in Script Editor, or with osascript -e in Terminal. macOS may ask whether Terminal is allowed to control each app. Allow it.
tell application "Mail"
get name of every account
end telltell application "Calendar"
get name of every calendar
end telltell application "Contacts"
get name of every group
end tellIf all three return lists, the accounts are present and the apps respond.
Exercise
You turn off the Calendars switch for your work Exchange account in Internet Accounts. What happens to your work mail, and what happens to the work events?
Show answer
Mail keeps working, because the Mail switch is separate. The work events disappear from Calendar on your Mac, but they stay on the Exchange server and return when you turn the switch back on.