live_get_selection
Read the current Word or LibreOffice selection and its starting paragraph address for follow-up edits with doc.batch or text.replace. Use when a user points at text like “this paragraph” or “here”.
Instructions
Read what the user has selected in Word or LibreOffice right now, and the paragraph the selection starts in with its address (p12#a1b2c3d4), to edit with doc.batch or text.replace. Use it when the user points at text ("this paragraph", "here"); live.select moves the selection instead. The document must be attached with live.open (ENGINE_UNAVAILABLE otherwise). Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Path to the document, or the file name of one open in a live app. | |
| engine | No | Always the live engine; may be left out. |
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. |