save_before_external_write
Save an open KiCad board to disk before an external file-based tool modifies it; refuse dirty or unknown documents unless saving is explicitly allowed.
Instructions
Before a file-based tool (kct) touches a board open in KiCad, make the file on disk match the editor. A board proven clean is left alone. A dirty board, or one whose dirty state is unknown (always possible on KiCad 10), is refused unless allow_save=true; then it is saved and the file is checked to have changed. Returns each document's state before, the action (none/saved/refused) and the file SHA-256 plus editor_sha256 to pass to sync_from_disk. The schematic cannot be saved over KiCad 10's API: it is refused unless schematic_unverified_ok=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documents | No | ||
| allow_save | No | ||
| schematic_unverified_ok | No |