Set mail status
Marks the messages selected in Mail as read, flagged, junk, deleted or archived.
Mark the selected mail as status
Keyboard Maestro: SetMailStatus
Details #
Applies one change to every message that is selected in the Mail app right now. It does not search for messages and does not look at which message a rule or trigger started from; whatever is highlighted in Mail is what changes.
The status is one of:
read and unread set the read state.
flag and unflag set the flag.
junk and notJunk set the junk state.
delete deletes the message (it goes to Mail's Trash).
archive moves the message to the "Archive" mailbox of the message's own account.
Matching ignores case, spaces and dashes, and a few other names are accepted: flagged, unflagged, markAsJunk and trash.
The output is the number of messages changed. The Trace note reads like marked 3 messages read.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
status | text | Yes | Required. read, unread, flag, unflag, junk, notJunk, delete or archive. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
- Mark the selected mail read
- Show “Marked as read”
Gotchas #
Fails with
no message is selected in Mailwhen nothing is selected, even though Mail itself was reached.Fails with
unknown mail status "<x>"and lists the allowed values for anything else.deleteandarchivemove real mail. Check the selection before you run a macro that does either.archiveneeds a mailbox named "Archive" on the message's account. If there isn't one, Mail reports an error and the step fails.The first run asks for permission to control Mail (System Settings > Privacy & Security > Automation).