edit_document
Edit .docx documents: replace text via find-and-replace, overwrite paragraphs by index, or append new paragraphs to the end.
Instructions
Edit a Word document (.docx): find-and-replace text, overwrite a paragraph by index, or append new paragraphs at the end. 'replacements' is a list of {find, replace} objects. 'set_paragraph' is {index, text} to overwrite one paragraph. 'append_paragraphs' is a list of strings to add at the end. Requires allow_file_write in ~/.syscontrol/config.json.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the .docx file. | |
| replacements | No | Find-and-replace pairs: [{"find": "old text", "replace": "new text"}, ...]. | |
| set_paragraph | No | Overwrite a paragraph by index: {"index": 0, "text": "New text"}. | |
| append_paragraphs | No | List of strings to append as new paragraphs at the end of the document. |