Write Document
write_documentReplace document text while preserving Scrivener formatting. Reports if formatting is fully preserved or takes a snapshot when non-round-trippable content would be dropped.
Instructions
Replace a document's text with new content, preserving the surrounding Scrivener formatting the edit did not touch (stylesheet, styles, images, footnotes) byte-for-byte. The result reports whether formatting was fully preserved; when an edit would drop non-round-trippable content it takes a Scrivener snapshot first (restorable in Scrivener) and says so. To change only the title or metadata use update_document; to add a new document use create_document. Requires an open project and a valid document id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Write even if the project appears open in Scrivener. Default false, which refuses the write to protect against your changes being overwritten by Scrivener on save. | |
| content | Yes | Document body as plain text. May be empty. | |
| documentId | Yes | Scrivener document UUID, as returned by get_structure (a binder item "id"). |