automating-mail

Automate Apple Mail tasks via JXA for reading, filtering, composing, and organizing messages.

63|12|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/iBz-04/gloamy --skill automating-mail
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: automating-mail
Source: https://github.com/iBz-04/gloamy/tree/main/skills/automating-mail
Command: npx skills add https://github.com/iBz-04/gloamy --skill automating-mail

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires PyXA, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Automates Apple Mail tasks so you can read, filter, compose, and organize messages without manually clicking through inboxes and mailboxes.

Core Features & Use Cases

  • Apple Mail automation (JXA-first): Uses JXA/JavaScript for Automation with AppleScript dictionary discovery to reliably access Mail.app objects like messages, mailboxes, signatures, and attachments.
  • Batch message workflows: Efficiently reads message properties in bulk and supports batch operations such as filtering, moving, archiving, and saving attachments.
  • Composition and UI fallback: Supports composing visible messages and uses UI scripting as a fallback for actions like signature selection when direct automation is limited.

Quick Start

Ask the skill to automate Apple Mail to read the latest message in your INBOX and print its subject.

Frequently Asked Questions about automating-mail

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Apple Mail to read and filter messages in bulk?

Batch message workflows in Apple Mail are automated by driving Mail.app through JXA with AppleScript dictionary discovery to access message properties in bulk. This enables efficient filtering, moving, archiving, and saving attachments across mailboxes without manual UI interaction.

Can I compose drafts and add attachments in Apple Mail using JavaScript for Automation?

Yes, composing drafts and adding attachments in Apple Mail is supported through JXA automation that drives Mail.app objects directly. It supports composing visible messages and uses UI scripting as a defensive fallback for actions like signature selection when direct object access is limited.

Does this Apple Mail automation approach work for inbox triage and mailbox archival on macOS?

Yes, this approach applies to inbox triage, mailbox archival, and batch message processing on macOS. It leverages a Mail JXA entrypoint with defensive checks for object access to ensure deterministic local automation of real-world organization workflows without manual UI steps.

What is AppleScript dictionary discovery and how does it help with Apple Mail message filtering?

AppleScript dictionary discovery is the mechanism used to translate and reliably access Mail.app objects like messages, mailboxes, signatures, and attachments through JXA. It enables deterministic local automation by ensuring defensive checks for object access during message filtering and organization workflows.

Do I need PyXA installed to run JXA scripts for Apple Mail automation?

Yes, PyXA is a required dependency to run the JXA scripts that drive Mail.app for Apple Mail automation. You need PyXA installed to execute the on-demand scripts and references used for message reading, filtering, composition, and attachment workflows.

What are the limitations of using JXA for Apple Mail composition and signature selection?

Direct automation through the Mail JXA entrypoint can be limited for certain actions like signature selection during composition. When direct object access is restricted, UI scripting is used as a fallback mechanism, applying defensive checks to ensure reliable Apple Mail automation workflows.