automating-word
Installation
SKILL.md
Automating Word (JXA-first, AppleScript discovery)
Relationship to the macOS automation skill
- Standalone for Word, aligned with
automating-mac-appspatterns. - Use
automating-mac-appsskill for permissions, shell execution, 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
- Word dictionary is AppleScript-first; discover there.
- JXA provides logic, data handling, and ObjC bridge access.
- Objects are specifiers; read via methods, write via assignments.
- Handle errors from Word operations using try/catch blocks and Application error checking.
Implementation Workflow
- Discover AppleScript Dictionary: Open Script Editor, browse Word's AppleScript dictionary to understand available objects and methods.
- Translate to JXA: Use discovered AppleScript syntax as reference for JXA equivalents, consulting the dictionary translation table.
- Set Up JXA Script: Initialize Word application object and document references.
- Implement Operations: Apply find/replace, table manipulation, or export using JXA methods.
- Test and Validate: Run script and verify document changes match expectations.