4D Form Screenshot
Capture a screenshot for a specific form and save it as Project/Sources/Forms/<FormName>/form.png.
Inputs
Accept either:
- A form name such as
Form1 - A path to
form.4DFormsuch asProject/Sources/Forms/Form1/form.4DForm - A path to the form folder if that folder contains
form.4DForm
Optionally append : followed by a page number to capture a specific page (e.g. Form1:2). Page 0 is the shared page. If omitted, page 1 is used by default.
Pass the raw form input through --user-param. The bundled _formScreenshot.4dm resolves a form.4DForm path to the form name and parses the optional page number before calling FORM SCREENSHOT.
Use /4d-run
Use the /4d-run skill to locate tool4d and to run the startup method.
Workflow
- Locate the current
.4DProject. - Copy
assets/_formScreenshot.4dmtoProject/Sources/Methods/_formScreenshot.4dmif it is missing. - Keep the user input unchanged and pass it as
--user-param=<form name or path>(append:<page>when a specific page is requested, e.g.--user-param=Form1:2). - Use
/4d-runto run_formScreenshoton the current project. - Prefer
tool4dfirst. If/4d-runneeds the full 4D runtime, use the user-provided 4D executable path through/4d-run. - If the run crashes because
defaultJsonForm.jsonis missing, copyassets/defaultJsonForm.jsoninto theResourcesfolder of the runtime being used, then retry. - Return the generated screenshot path:
Project/Sources/Forms/<FormName>/form.png.
Missing defaultJsonForm.json
Some runtimes crash on FORM SCREENSHOT when defaultJsonForm.json is missing.
When that happens:
- If
/4d-runis usingtool4d.app, copy the bundledassets/defaultJsonForm.jsontotool4d.app/Contents/Resources/defaultJsonForm.json - Retry the same
_formScreenshotrun afterward