live_close
Close an open Word or LibreOffice document safely; save and close, or discard unsaved changes. Unsaved edits are never lost silently.
Instructions
Close the document in its Word or LibreOffice window (attached with live.open). With unsaved changes it is refused (UNSAVED_CHANGES) unless save (save, then close) or discard (drop them) is given; nothing unsaved is ever lost silently. Use live.save to keep the window open. Returns whether it saved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Path to the document, or the file name of one open in a live app. | |
| save | No | Save, then close. | |
| engine | No | Always the live engine; may be left out. | |
| discard | No | Close and drop the unsaved changes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Always true on success. | |
| op | Yes | The operation that ran. | |
| api | Yes | API version (1.0). | |
| doc | No | The document read or written: path, sha256 and paragraph count. | |
| next | Yes | Cursor for the next page (pass as cursor), or null. | |
| result | Yes | What the operation returns. | |
| warnings | Yes | Things to know about the result. |