Patchwork
v0.1.0Let your AI agent edit FileMaker: fields, scripts, value lists, layouts and themes, all reversible.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
patchwork_open
Open a closed .fmp12 as a new working copy (v000). Never modifies the source. The password comes from PATCHWORK_PASSWORD.
| Parameter | Type | Description |
|---|---|---|
account * | string | |
source * | string | |
force | boolean | Replace an existing workspace. |
no_password | boolean | |
project | string | Folder for the .patchwork workspace. Default: the source file's folder. |
patchwork_status
Current version, source file and object counts.
patchwork_list
List objects: layouts, scripts, value-lists, custom-functions, themes, tables, table-occurrences, or fields (with table).
| Parameter | Type | Description |
|---|---|---|
kind | string | |
table | string |
patchwork_show
Show one object. A script comes as FileMaker text, one step per line (xml=true for its XML). Other kinds come as Save-as-XML. kind=field takes Table::Field. kind=step shows the XML of a real step by its name, e.g. 'Set Field'.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
name * | string | |
xml | boolean |
patchwork_add_field
Add a field to a table. type: Text, Number, Date, Time, Timestamp, Container. With calc it becomes a calculation.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
table * | string | |
calc | string | |
comment | string | |
context | string | Table occurrence the calculation is evaluated from. |
dry_run | boolean | Only write the patch, do not apply it. |
is_global | boolean | |
message | string | What this change does, kept in the version log. |
type | string |
patchwork_add_value_list
Add a custom value list.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
values * | array | |
dry_run | boolean | Only write the patch, do not apply it. |
message | string | What this change does, kept in the version log. |
patchwork_add_custom_function
Add a custom function.
| Parameter | Type | Description |
|---|---|---|
calc * | string | |
name * | string | |
dry_run | boolean | Only write the patch, do not apply it. |
message | string | What this change does, kept in the version log. |
params | array |
patchwork_add_script
Create a script. steps: FileMaker script text, one step per line, or <Step> XML. Text works 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.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
dry_run | boolean | Only write the patch, do not apply it. |
message | string | What this change does, kept in the version log. |
steps | string | 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. |
patchwork_set_steps
Replace all the steps of a script with the text from patchwork_show, edited. Lines left as they were keep their step exactly, whatever the step.
| Parameter | Type | Description |
|---|---|---|
script * | string | |
steps * | string | 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 | boolean | Only write the patch, do not apply it. |
message | string | What this change does, kept in the version log. |
patchwork_append_steps
Add steps at the end of a script.
| Parameter | Type | Description |
|---|---|---|
script * | string | |
steps * | string | 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 | boolean | Only write the patch, do not apply it. |
message | string | What this change does, kept in the version log. |
patchwork_replace
Replace a whole object with edited XML from patchwork_show. Supported: layout, theme, value-list, custom-function.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
name * | string | |
xml * | string | |
dry_run | boolean | Only write the patch, do not apply it. |
message | string | What this change does, kept in the version log. |
patchwork_place_field
Put a field on a layout. Copies the look and label of `near`, a field already on the layout, and inserts a row below it (objects underneath move down, the part grows). side=right places it next to `near` if there is room.
| Parameter | Type | Description |
|---|---|---|
field * | string | Occurrence::Field, e.g. Clients::Status |
layout * | string | |
near * | string | |
dry_run | boolean | Only write the patch, do not apply it. |
label | string | Label text. Default: the field name. |
message | string | What this change does, kept in the version log. |
side | string |
patchwork_uses
What uses an object: references (certain) and mentions by name in calculations (possible). Call it before deleting or renaming. Kinds: layout, script, value-list, custom-function, table, table-occurrence, field (Table::Field).
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
name * | string |
patchwork_delete
Delete an object: script, layout, value-list, custom-function, or field (Table::Field). Refused when other objects reference it: show the list to the user, and only then retry with force=true.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
name * | string | |
dry_run | boolean | Only write the patch, do not apply it. |
force | boolean | |
message | string | What this change does, kept in the version log. |
patchwork_retheme
Rewrite a theme: colors (map of hex to hex), fonts (map 'WinName,MacName' to 'WinName,MacName'), new display name.
| Parameter | Type | Description |
|---|---|---|
colors | object | |
dry_run | boolean | Only write the patch, do not apply it. |
fonts | object | |
message | string | What this change does, kept in the version log. |
rename | string | |
theme | string |
patchwork_recolor_layouts
Rewrite the layouts that change: local colors, fonts, or one field swapped for another everywhere.
| Parameter | Type | Description |
|---|---|---|
colors | object | |
dry_run | boolean | Only write the patch, do not apply it. |
fonts | object | |
message | string | What this change does, kept in the version log. |
only | array | |
swap_field | array |
patchwork_palette
Colors a theme uses, most frequent first.
| Parameter | Type | Description |
|---|---|---|
theme | string |
patchwork_push
Apply a hand-written FMUpgradeToolPatch. Prefer the specific tools.
| Parameter | Type | Description |
|---|---|---|
patch_xml * | string | |
dry_run | boolean | Only write the patch, do not apply it. |
message | string | What this change does, kept in the version log. |
patchwork_log
Version history with the changes of each version.
patchwork_undo
Drop the last version.
patchwork_save
Write the current version to a new .fmp12 file (never the source).
| Parameter | Type | Description |
|---|---|---|
dest * | string | |
force | boolean |