Agent skill · writing content · aiskillstore
apple-mail
Comprehensive guide for accessing and automating Apple Mail using AppleScript, including reading emails, sending messages, and managing mailboxes.
Why this skill is useful
Provides specific AppleScript commands and patterns for automating Apple Mail that the AI wouldn't reliably generate on its own.
What it needs
About 10k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Apple Mail AppleScript Skill This skill provides comprehensive guidance on using AppleScript to automate Apple Mail operations, including reading emails, sending messages, and managing mailboxes. Core Principles 1. Access mailboxes through account objects - Don't try to access inbox directly on accounts 2. Iterate through mailboxes to find the right one - Mailbox names can vary (INBOX, Inbox, etc.) 3. Use account name matching - Match on account name rather than email address property 4. Handle errors gracefully - AppleScript errors can be cryptic, use trial and error with different approaches Common Query Patterns 1. List All Mail Accounts Always start by listing accounts to verify the account exists and get the correct name: Example output: 2. Read Last N Emails from an Account The correct pattern for accessing emails from a specific account: Key lessons from trial and error: ❌ WRONG: inbox of targetAccount (doesn't work, causes error -1728) ❌ WRONG: address of acc (address property doesn't exist reliably) ✅ CORRECT: every mailbox of targetAccount then iterate to find "INBOX" or "Inbox" 3. Read Email Content Get the full body content of a specific email: 4. Send an Email Create and send a new email: Options: visible:true - Shows the compose window before sending (useful for review) visible:false - Sends silently in the background 5. Reply to an Email Reply to an existing email (preserves threading): Key points: Use reply originalMsg to create a threaded reply (NOT make new outgoing message) The reply command automatically sets the recipient and subject with "Re:" Don't use with opening window false parameter, it causes syntax errors Set the content of the reply before sending Reply vs New Email: ❌ WRONG: Creating new message to same recipient (breaks threading) ✅ CORRECT: Using reply command on original message (maintains threading) 6. Search Emails by Subject Find emails matching a subject keyword: 7. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/apple-mail