automating-pages

automating-pages is a skill for Claude Code from SpillwaveSolutions/automating-mac-apps-plugin. It costs 68 tokens per session (1,105 once invoked), scanned A, original, MIT.

A guide for controlling Apple Pages on macOS with JavaScript for Automation (JXA), Apple's scripting system. It covers documents, templates, text, styles, tables, images, and exporting to PDF.

In plain words
What is it for?
Use it to create and edit Pages documents, apply formatting, work with tables and images, and export documents programmatically.
Why use it?
It helps replace repetitive Pages editing and export steps with scripts. It also shows how to discover Pages commands before translating them into JavaScript.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the automating-mac-apps plugin — 16 skills, 10 commands, 9 agents shipped together

Good fit Use it to create and edit Pages documents, apply formatting, work with tables and images, and export documents programmatically.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/spillwavesolutions/automating-mac-apps-plugin/automating-pages
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SpillwaveSolutions/automating-mac-apps-plugin --skill automating-pages
Clone the repo
git clone --depth 1 https://github.com/SpillwaveSolutions/automating-mac-apps-plugin

Made for: Claude Code.

Or install automating-mac-apps, the plugin that ships this one along with the rest of its 16 skills, 10 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for automating-pages

README.md
[![agentmods](https://agentmods.dev/badge/skills/spillwavesolutions/automating-mac-apps-plugin/automating-pages/github.svg)](https://agentmods.dev/skills/spillwavesolutions/automating-mac-apps-plugin/automating-pages)
Your own site
<a href="https://agentmods.dev/skills/spillwavesolutions/automating-mac-apps-plugin/automating-pages"><img src="https://agentmods.dev/badge/skills/spillwavesolutions/automating-mac-apps-plugin/automating-pages/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for automating-pages

Your own site · 80×15
<a href="https://agentmods.dev/skills/spillwavesolutions/automating-mac-apps-plugin/automating-pages"><img src="https://agentmods.dev/badge/skills/spillwavesolutions/automating-mac-apps-plugin/automating-pages.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,105 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01105
Opus 5.5 $0.00027 $0.00442
Sonnet 5.5 $0.00014 $0.00221
Haiku 4.5 $0.00007 $0.00111

Measured 1mo ago against content hash 07c75f384b4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

automating-pages scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/insert_images.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/automating-mac-apps-plugin/skills/automating-pages/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Automating Pages (JXA-first, AppleScript discovery)

Relationship to the macOS automation skill

  • Standalone for Pages, aligned with automating-mac-apps patterns.
  • Use automating-mac-apps for permissions, shell, and UI scripting guidance.
  • PyXA Installation: To use PyXA examples in this skill, see the installation instructions in automating-mac-apps skill (PyXA Installation section).

Core framing

  • Pages dictionary is AppleScript-first; discover there.
  • JXA provides the logic and data handling.
  • Objects are specifiers: References to Pages elements that require methods for reads (e.g., doc.body.text()) and assignments for writes (e.g., doc.body.text = 'new text').

Example: Create Document

const pages = Application('Pages');
const doc = pages.Document({templateName: 'Blank'});
pages.documents.push(doc);
doc.body.text = "Hello World";

Workflow (default)

  1. Discover: Open Script Editor > File > Open Dictionary > Pages.
  2. Prototype: Write minimal AppleScript to verify the command works.
  3. Port to JXA: Convert AppleScript syntax to JXA objects.
    • Example: make new document becomes pages.documents.push(pages.Document()).
    • Add error handling (try/catch blocks).
  4. Optimize: Use batch text operations when possible to avoid performance penalties.
  5. Fallback: Use AppleScript bridge or UI scripting for dictionary gaps (e.g., specific layout changes).

Image Insertion (Critical Difference from Keynote)

IMPORTANT: Pages does NOT support direct image insertion like Keynote does:

// THIS WORKS IN KEYNOTE:
Keynote.Image({ file: Path("/path/to/image.png"), position: {x: 100, y: 100} });

// THIS DOES NOT WORK IN PAGES!
Pages.Image({ file: Path("/path/to/image.png") }); // ❌ Will fail

Solution: Use ObjC Pasteboard bridging (see pages-advanced.md for details):

ObjC.import('AppKit');
const nsImage = $.NSImage.alloc.initWithContentsOfFile("/path/to/image.png");
const pb = $.NSPasteboard.generalPasteboard;
pb.clearContents;
pb.setDataForType(nsImage.TIFFRepresentation, $.NSPasteboardTypeTIFF);
// Then use System Events to paste (Cmd+V)

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 99 lines · 68 tokens per session scan A 07c75f384b4a

Subscribe to this mod's changes

automating-pages is a skill published in the GitHub repository SpillwaveSolutions/automating-mac-apps-plugin (46 stars, last pushed 2mo ago), licensed MIT. It adds 68 tokens to every session and 1,105 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.