automating-messages

Automate Apple Messages sends and history reads via JXA and SQLite.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you automate Apple Messages (iMessage/SMS) on macOS for reliable sending, attachment delivery, and optional message-history reads.

Core Features & Use Cases

  • Reliable send automation (JXA-first): Resolves the correct Messages service and buddy, then uses app-level send to avoid JXA misrouting.
  • Attachments via UI fallback: Uses Accessibility + clipboard/paste workflows when Messages has no stable JXA attachment API.
  • History access via chat.db forensics: Reads message history using SQLite with Full Disk Access, including Cocoa epoch conversion and typedstream notes.
  • Bots and monitoring: Supports polling-style “bot” operation using launchd and rowid diffs when event handlers are gone.

Quick Start

Tell the agent to automate sending a Messages text to a specific handle on iMessage, and include the required macOS permissions for Automation, Accessibility, and (if you need history) Full Disk Access.

Frequently Asked Questions about automating-messages

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

FAQPage Schema
How do I automate sending iMessage texts on macOS using JXA?

To automate sending iMessage texts on macOS using JXA, you must resolve the correct Messages service by serviceType, target the specific buddy by handle, and use the app-level Messages.send function to avoid misrouting.

Can I read macOS message history from chat.db for a monitoring bot?

Yes, you can read macOS message history from chat.db by executing SQLite queries against ~/Library/Messages/chat.db, which requires Full Disk Access and involves Cocoa epoch conversion to parse timestamps accurately for monitoring bots.

What's the best way to send attachments through Apple Messages automation?

The best way to send attachments through Apple Messages automation is using a UI scripting fallback, because Messages lacks a stable JXA attachment API, requiring Accessibility permissions and clipboard or paste workflows.

Do I need launchd to run a polling bot for Apple Messages?

Yes, you need launchd to run a polling bot for Apple Messages because event handlers are gone, requiring you to schedule polling operations and track rowid diffs in the chat database to detect new messages reliably.

Why does JXA message sending fail without resolving Messages.services?

JXA message sending fails without resolving Messages.services because the system cannot deterministically map the target buddy to the correct iMessage or SMS service type, causing delivery misrouting.

What macOS permissions are required to automate Messages and read chat history?

Automating Messages and reading chat history requires Automation and Accessibility permissions for JXA sending and UI fallbacks, plus Full Disk Access if you need to query the SQLite chat.db file for history extraction.