Create a new script in the file
patchwork_add_scriptCreate a new FileMaker script from plain-text steps or XML, with each step verified after the change and a new version made for undo. Use it to add scripts; edit existing ones with set or append steps.
Instructions
Create a new script, empty when steps is omitted. Each step is re-read after the change, and the version is dropped with an error if one came back different. To change a script that exists, use patchwork_set_steps or patchwork_append_steps. Text is understood for: # (comment), Allow User Abort, Beep, Close Window, Commit Records/Requests, Delete Record/Request, Else, Else If, End If, End Loop, Exit Loop If, Exit Script, Freeze Window, Go to Layout, Halt Script, If, Loop, New Record/Request, Perform Script, Refresh Window, Set Error Capture, Set Field, Set Variable, Show All Records, Show Custom Dialog. For any other step, get a model with patchwork_show kind=step and send XML. Makes a new version; patchwork_undo reverses it.
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": {
"name": "<name>"
},
"name": "patchwork_add_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the new script. | |
| steps | No | One step per line, as FileMaker shows them: Set Variable [ $n ; Value: 1 ], If [ $n > 0 ], Show Custom Dialog [ "Title" ; "Message" ; Buttons: "OK", "Cancel" ], End If, # comment. Or <Step> XML. | |
| dry_run | No | Only write the patch file to .patchwork/ and return its path. Nothing is applied, no version is made. | |
| message | No | What this change does, kept in the version log. Default: a short description of the change. |