pages_replace
Find and replace text in a Pages document without altering formatting, then save. Fails if the text is not found, leaving the file unchanged.
Instructions
Replace text in an existing Pages document, and save it.
Preserves formatting: only the paragraphs containing the searched string are touched, and the others keep their size, colour and style. This is the tool for filling in a template — a contract, a letter — by replacing placeholders.
If the string does not appear, the document is left untouched and the call fails: better an error than a "done" on a file that stayed the same.
Args:
path: the .pages file to modify.
search: the text to find. Does not cross line breaks: look for something
that sits inside a single paragraph.
replacement: the text that takes its place.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| search | Yes | ||
| replacement | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |