apply_style
Apply paragraph or character styles to text matched by plain text or GREP, whole frames/stories, or specific paragraphs; optionally clear hand formatting so the style fully controls the text.
Instructions
Apply a paragraph or character style. Target text by findWhat (plain text or GREP, whole document or one frame), by frameIndex (whole story), or by frameIndex + paragraphIndex. Paragraph styles apply to every paragraph the match touches; character styles apply to exactly the matched text. clearOverrides removes hand formatting so the style fully controls the text. Examples: chapter numbers {type:"paragraph", styleName:"Chapter Number", findWhat:"^Chapter \d+$", useGrep:true}; italics for a book title {type:"character", styleName:"Italic", findWhat:"The Book Title"}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"type": "<type>",
"styleName": "<styleName>"
},
"name": "apply_style"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | ||
| useGrep | No | ||
| findWhat | No | Text (or GREP if useGrep) to find | |
| pageIndex | No | 0-based page index for frameIndex | |
| styleName | Yes | ||
| frameIndex | No | Limit to the story of this text frame (with pageIndex) | |
| caseSensitive | No | ||
| clearOverrides | No | Remove local (hand) formatting in the targeted text | |
| paragraphIndex | No | With frameIndex and no findWhat: only this paragraph (0-based) |