automating-pages
Installation
SKILL.md
Automating Pages (JXA-first, AppleScript discovery)
Relationship to the macOS automation skill
- Standalone for Pages, aligned with
automating-mac-appspatterns. - Use
automating-mac-appsfor permissions, shell, and UI scripting guidance. - PyXA Installation: To use PyXA examples in this skill, see the installation instructions in
automating-mac-appsskill (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";