set_paragraph_text
Replace a paragraph's text without losing its formatting. Use location to target a paragraph, pass an 'expect' substring to confirm the right one, and get automatic backup with atomic saves.
Instructions
Replace one paragraph's full text, keeping style and base formatting; address it with a location object ({paragraph: N}, {search: ...}, {outline: ...}). Indices shift after edits, so pass expect (a substring the target must contain) to refuse instead of hitting the wrong paragraph; verify the returned replaced_text. Auto-backup in file mode (backup=False skips rotation); atomic validated save. Edits go live on open documents (serialized); tracked-revision paragraphs refuse live. For batches, use apply_edits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| live | No | auto | |
| backup | No | ||
| expect | No | ||
| location | Yes | ||
| new_text | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||