Skip to content
Agentmart
Submit a tool

automating-mail

Automates Apple Mail via JXA with AppleScript dictionary discovery.

Skill by wopal-cn

IndexedMIT★ 3
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/wopal-cn-automating-mail

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: design, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 2

  • codeload.github.com · found in install command
  • github.com · found in code

Files it touches

  • ~/.claude/skills/automating-mail

What's inside

Skill name
automating-mail
Description
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.
License
MIT
Instructions
81 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Agent Skills spec issues

  • allowed-tools: must be a space-separated string

Files (18)

  • .source.json
  • SKILL.md
  • attachment-extraction.md · references/
  • html-data-merge.md · references/
  • html-signature-workflow.md · references/
  • mail-advanced.md · references/
  • mail-basics.md · references/
  • mail-dictionary.md · references/
  • mail-pyxa-api-reference.md · references/
  • mail-recipes.md · references/
  • mail-rules.md · references/
  • mailbox-archiver.md · references/
  • create_email.py · scripts/
  • create_mail_rule.py · scripts/
  • extract_emails_to_contacts.py · scripts/
  • search_and_archive.py · scripts/
  • set_up_mail_automation.py · scripts/
  • set_up_mail_automation.sh · scripts/

SKILL.md (first lines)

# Automating Apple Mail (JXA-first, AppleScript discovery)

## Contents
- [Relationship to macOS automation skill](#relationship-to-the-macos-automation-skill)
- [Core Framing](#core-framing)
- [Workflow](#workflow-default)
- [Quick Start Examples](#quick-start-examples)
- [Validation Checklist](#validation-checklist)
- [When Not to Use](#when-not-to-use)
- [What to load](#what-to-load)

## Relationship to the macOS automation skill
- Use `automating-mac-apps` for permissions, shell, and UI scripting guidance.
- **PyXA Installation:** See `automating-mac-apps` skill (PyXA Installation section).

## Core Framing
- Mail dictionary is AppleScript-first; discover in Script Editor.
- Objects are specifiers: read via method calls (`message.subject()`), modify via assignments (`message.readStatus = true`).
- ObjC bridge available for advanced filesystem operations.

## Workflow (default)
1) [ ] Ensure Mail configured and automation permissions enabled.
2) [ ] Discover terms in Script Editor (Mail dictionary).
3) [ ] Prototype minimal AppleScript command.
4) [ ] Port to JXA with defensive checks.
5) [ ] Use batch reads for performance.
6) [ ] Use UI scripting for signature and UI-only actions.

## Quick Start Examples

**Read inbox (JXA):**
```javascript
const Mail = Application('Mail');
const message = Mail.inbox.messages[0];
console.log(message.subject());
```

**Compose message (JXA):**
```javascript
const msg = Mail.OutgoingMessage({
  subject: "Status Update",
  content: "All systems go."
});
Mail.outgoingMessages.push(msg);
msg.visible = true;
```

**PyXA alternative:**
```python
import PyXA
mail = PyXA.Mail()
inbox = mail.inboxes()[0]
message = inbox.messages()[0]
print(f"Subject: {message.subject()}")
```

## Validation Checklist
- [ ] Automation permissions granted (System Settings > Privacy > Automation)
- [ ] Inbox access works: `Mail.inbox.messages.length`
- [ ] Message property reads return expected values
- [ ] Composition creates visible draft
- [ ] Batch operations complete without errors

## When Not to Use
- For cross-platform email automation (use IMAP/SMTP libraries)
- For bulk email sending (use transactional email services like SendGrid)
- When processing untrusted email content (security risk)
- For non-macOS platforms

## What to load
- Mail JXA basics: `automating-mail/references/mail-basics.md`
- Recipes (filter, move, compose): `automating-mail/references/mail-recipes.md`
- Advanced patterns (batch ops, HTML, signatures): `automating-mail/references/mail-advanced.md`
- Dictionary translation table: `automating-mail/references/mail-dictionary.md`
- Rule scripts: `automating-mail/references/mail-rules.md`
- HTML + signature workflow: `automating-mail/references/html-signature-workflow.md`
- Attachment extraction pipeline: `automating-mail/references/attachment-extraction.md`
- Mailbox archiver: `automating-mail/references/mailbox-archiver.md`
- HTML data merge: `automating-mail/references/html-data-merge.md`
- **PyXA API Reference** (complete class/method docs): `automating-mail/references/mail-pyxa-api-reference.md`

From wopal-cn/wopal-space-ontology, MIT.

More from wopal-cn/wopal-space-ontology

Signals

Stars
3
Forks
1
Open issues
0
Last commit (this folder)
Sep 15, 2026 (1 month ago)
Last release
Oct 24, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from wopal-cn

Cite this page

automating-mail skill. Agent Mart. https://agentmart.dev/skills/wopal-cn-automating-mail (last updated 2026-10-24)