Native scripts and their recovery
Native Python handles tasks through script.native.v1 and the existing
conversation workflow. Specify the font, glyphs, masters, layers and
foreground/background surface that the task should affect. Start on a disposable
font when experimenting.
Write, review or run
Write a script for my selected layers, but do not run it. Explain what it will change.
A write-only/review-only request does not execute. A request to perform a font task can already authorize its in-scope execution; a separate code-review click is not required. Ask for an explicit preview when you want to review before execution. Wait for my answer separately disables automatic Keep after execution. Optional View details shows source/parameters, output and the full request.
With script.apply-authorized.v1, an authorized Apply request runs after internal
preparation without another Run action. Explicit previews still stop before
execution. A reconnect never replays an interrupted request.
Preparation checks syntax and resolves targets without running module code.
Dirty, clean and pathless fonts run without Save. The coordinated development
runtime requires script.recovery.snapshot.v1 and preparation version 3; it
captures a private in-memory full-font copy before execution. The original file
is untouched. Snapshot failure stops execution before any Python runs.
For a demo, use duplicate_document to copy the current font, including unsaved
edits, into a new pathless font. Run scripts and open proof tabs in that copy.
The script runs once on Glyphs' main thread. Per-target callbacks yield between batches; cancellation stops remaining callbacks, not a running invocation. Whole scripts run once without per-target cancellation. Execution success does not prove the intended design result: inspect the font and verify relevant values.
Decide what to keep
After execution, use the offered Keep changes without saving, Save font or Restore before run actions. Ask unresolved decisions with native questions when available, grouping related independent questions; otherwise use ordinary chat. Routine progress, success and errors stay in the conversation. A card is optional for useful evidence, substantial reports, live controls or recovery.
With Automatic Keep enabled, a visible, connected and freshly reconciled successful result card can Keep after 30 seconds; Pause countdown disables that countdown. Before it starts, use Turn off automatic Keep, or say Wait for my answer in the conversation. Restore before run is under More options after success and remains a main choice when partial edits need recovery. Failed or partial execution remains a manual decision and can leave edits behind. Blocked and uncertain outcomes also remain manual. Disable Automatic Keep before waiting on a native answer. Silence, Skip and dismissal apply no choice and preserve recovery; “wait for my answer” remains in effect until changed.
Restore before run restores the pre-run memory copy for the whole font, including edits that were already unsaved before Run. It replaces all later unsaved edits, including manual edits outside the script's targets, clears Undo history and returns a fresh document binding. It does not save or rerun the script. Keep or Save ends this offer; a changed path, closed font or Glyphs restart makes restoration unavailable. It provides no crash recovery.
Scripts can also affect files, network services or other computer state. Reloading the font does not reverse those effects. Typed Undo these changes and its target snapshots do not provide script rollback.
If the connection times out, use Check result on the retained workflow. Never submit a new script request merely to bypass an uncertain result. See Safety and recovery.
When a useful card is open, it refreshes while choices remain, including recovery after cancellation. If an offered choice has expired, the card checks the current workflow and removes obsolete buttons. If the check fails, use Check status. Text-only clients use the same retained workflow and current choices; old conversation messages may remain visible as history. Opening View details or More options pauses automatic Keep; ordinary successful background checks do not reset an unchanged countdown.