From automating-mac-apps
Automates Apple Mail via JXA with AppleScript dictionary discovery. Use when asked to "automate email", "send mail via script", "JXA Mail automation", or "filter email messages". Covers accounts, mailboxes, batch message filtering, composition, attachments, and UI fallback.
npx claudepluginhub SpillwaveSolutions/automating-mac-apps-plugin --plugin automating-mac-appsThis skill is limited to using the following tools:
- [Relationship to macOS automation skill](#relationship-to-the-macos-automation-skill)
references/attachment-extraction.mdreferences/html-data-merge.mdreferences/html-signature-workflow.mdreferences/mail-advanced.mdreferences/mail-basics.mdreferences/mail-dictionary.mdreferences/mail-pyxa-api-reference.mdreferences/mail-recipes.mdreferences/mail-rules.mdreferences/mailbox-archiver.mdscripts/create_email.pyscripts/create_mail_rule.pyscripts/extract_emails_to_contacts.pyscripts/search_and_archive.pyscripts/set_up_mail_automation.pyscripts/set_up_mail_automation.shIntegrates with Apple Mail.app on macOS to read inbox, search emails, send/reply/manage messages via bash scripts using AppleScript and SQLite. Use for email automation tasks.
Share bugs, ideas, or general feedback.
automating-mac-apps for permissions, shell, and UI scripting guidance.automating-mac-apps skill (PyXA Installation section).message.subject()), modify via assignments (message.readStatus = true).Read inbox (JXA):
const Mail = Application('Mail');
const message = Mail.inbox.messages[0];
console.log(message.subject());
Compose message (JXA):
const msg = Mail.OutgoingMessage({
subject: "Status Update",
content: "All systems go."
});
Mail.outgoingMessages.push(msg);
msg.visible = true;
PyXA alternative:
import PyXA
mail = PyXA.Mail()
inbox = mail.inboxes()[0]
message = inbox.messages()[0]
print(f"Subject: {message.subject()}")
Mail.inbox.messages.lengthautomating-mail/references/mail-basics.mdautomating-mail/references/mail-recipes.mdautomating-mail/references/mail-advanced.mdautomating-mail/references/mail-dictionary.mdautomating-mail/references/mail-rules.mdautomating-mail/references/html-signature-workflow.mdautomating-mail/references/attachment-extraction.mdautomating-mail/references/mailbox-archiver.mdautomating-mail/references/html-data-merge.mdautomating-mail/references/mail-pyxa-api-reference.md