- Change code blocks from PowerShell to Bash for macOS examples across all adapters. - Add macOS-specific instructions for running context scripts in the documentation of each adapter. - Update session file paths to reflect user-scoped locations for both Windows and macOS. - Enhance overall clarity and consistency in the documentation for better user experience.
2.4 KiB
InDesign Notes
Bridge:
python adapters/indesign_adapter/indesign_bridge.py --stdin
Runtime:
- Windows: COM
InDesign.Application->DoScript(JavaScript). - macOS: AppleScript
do script ... language JavaScript.
Context:
Windows:
Get-Content adapters/indesign_adapter/examples/context.jsx -Raw | python adapters/indesign_adapter/indesign_bridge.py --stdin
macOS:
cat adapters/indesign_adapter/examples/context.jsx | python adapters/indesign_adapter/indesign_bridge.py --stdin
Local Memory
If APP.local.md exists in this directory, review it before performing an
operation when local installation details, prior failures, or version-specific
behavior may matter.
After completing an operation, if you encountered a repeatable issue or
verified something worth remembering about this local installation, add a short
note to APP.local.md.
Keep notes concise and factual. Record only local, reusable insights such as
verified quirks, recovery steps, version-specific gaps, or runtime-discovered
details. Do not copy general guidance from APP.md, and do not add temporary
task-specific notes.
API lookup workflow:
- Use
docs/api-index.txtas the primary operation index. - Workflow for every task:
- Understand the user's intent.
- Search (
rg)docs/api-index.txtfor matching operations. - If needed, introspect the live app/runtime to resolve ambiguity.
- If still needed, search official documentation online.
- Avoid over-relying on training, as it's fragile and can break. Do not directly read the index file, which can be heavy.
Connection recovery:
If the bridge cannot connect, ask the user to open InDesign and retry the context command. This adapter connects to the running app by default; do not launch InDesign unless the user explicitly asks.
InDesign-specific notes:
- JavaScript language id is
1246973031. - Layout tasks often live under document, page, margin, grid, style, layer, and selection objects.
- For measurements, set and restore
app.scriptPreferences.measurementUnitinside the script. - Prefer one bounded
DoScriptcall per requested edit. - For visually judged layout or page changes, prefer the temporary
preview-verification workflow in
shared/coexistence.mdinstead of assuming the visible result. - Grep-friendly operation index:
docs/api-index.txt(records are prefixed withCLASS,ENUM,PROPERTY,METHOD).