Patchwork

v0.1.0
io.github.Abdeltoto/patchwork Checked 4 days ago Published 26 days ago

Let 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.

ParameterTypeDescription
account *string
source *string
forcebooleanReplace an existing workspace.
no_passwordboolean
projectstringFolder 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).

ParameterTypeDescription
kindstring
tablestring

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'.

ParameterTypeDescription
kind *string
name *string
xmlboolean

patchwork_add_field

Add a field to a table. type: Text, Number, Date, Time, Timestamp, Container. With calc it becomes a calculation.

ParameterTypeDescription
name *string
table *string
calcstring
commentstring
contextstringTable occurrence the calculation is evaluated from.
dry_runbooleanOnly write the patch, do not apply it.
is_globalboolean
messagestringWhat this change does, kept in the version log.
typestring

patchwork_add_value_list

Add a custom value list.

ParameterTypeDescription
name *string
values *array
dry_runbooleanOnly write the patch, do not apply it.
messagestringWhat this change does, kept in the version log.

patchwork_add_custom_function

Add a custom function.

ParameterTypeDescription
calc *string
name *string
dry_runbooleanOnly write the patch, do not apply it.
messagestringWhat this change does, kept in the version log.
paramsarray

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.

ParameterTypeDescription
name *string
dry_runbooleanOnly write the patch, do not apply it.
messagestringWhat this change does, kept in the version log.
stepsstringOne 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.

ParameterTypeDescription
script *string
steps *stringOne 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_runbooleanOnly write the patch, do not apply it.
messagestringWhat this change does, kept in the version log.

patchwork_append_steps

Add steps at the end of a script.

ParameterTypeDescription
script *string
steps *stringOne 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_runbooleanOnly write the patch, do not apply it.
messagestringWhat 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.

ParameterTypeDescription
kind *string
name *string
xml *string
dry_runbooleanOnly write the patch, do not apply it.
messagestringWhat 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.

ParameterTypeDescription
field *stringOccurrence::Field, e.g. Clients::Status
layout *string
near *string
dry_runbooleanOnly write the patch, do not apply it.
labelstringLabel text. Default: the field name.
messagestringWhat this change does, kept in the version log.
sidestring

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).

ParameterTypeDescription
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.

ParameterTypeDescription
kind *string
name *string
dry_runbooleanOnly write the patch, do not apply it.
forceboolean
messagestringWhat 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.

ParameterTypeDescription
colorsobject
dry_runbooleanOnly write the patch, do not apply it.
fontsobject
messagestringWhat this change does, kept in the version log.
renamestring
themestring

patchwork_recolor_layouts

Rewrite the layouts that change: local colors, fonts, or one field swapped for another everywhere.

ParameterTypeDescription
colorsobject
dry_runbooleanOnly write the patch, do not apply it.
fontsobject
messagestringWhat this change does, kept in the version log.
onlyarray
swap_fieldarray

patchwork_palette

Colors a theme uses, most frequent first.

ParameterTypeDescription
themestring

patchwork_push

Apply a hand-written FMUpgradeToolPatch. Prefer the specific tools.

ParameterTypeDescription
patch_xml *string
dry_runbooleanOnly write the patch, do not apply it.
messagestringWhat 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).

ParameterTypeDescription
dest *string
forceboolean