Browse the docs

mailInfo

Returns text from the selected Mail message: sender, subject, recipients, body and more.

Keyboard Maestro: MailSender, MailSubject, MailRecipients, MailContents

Details #

mailInfo(field) takes exactly one argument and returns text, read from the first message selected in Mail.

field (not case-sensitive) is sender, subject, recipients (all addresses), to, cc, bcc (addresses only), replyTo, contents (the body) or rawSource. A list of addresses comes back as Mail writes a list as text. An unknown field gives empty text.

Parameters #

Takes 1 argument. {{ mailInfo(text) }}

Examples #

mailInfo("subject")
→
mailInfo("sender")
→

Gotchas #

  • Needs Automation permission for Mail. When Mail isn't running, nothing is selected, or Mail takes over 5 seconds, you get empty text.

  • Only the first selected message is read.