Captur
mash.captur · Platform
Methods
Section titled “Methods”captur.check(file: mixed, field: mixed, message: mixed, options?: array) → array
Raise a CHECK on one value of a file, so it reaches people the way Captur’s own checks do: the “needs a check” count and list, the check card in the field panel and, when the share raises reviews, a review request.
mash.captur.check(file, “Total”, “Total does not match the PO”, {code: “po-total”}) mash.captur.check(file, “Unit price”, “Price differs from the PO”, {row: 3, code: “price”})
The field is named on THIS file and found only among its share’s fields. A header field takes no row; a line-item field takes row: n (1 = the first line, as the panel shows). code is the script’s own short id (default “script”): checking again with the same code REPLACES this script’s check instead of adding another. The message is plain text: its first line, secrets removed, at most 300 characters. A sandboxed script needs the right to write that field on that file. A person’s save of the value clears the check.
Returns {field, row, code, message}.
checks
Section titled “checks”captur.checks(file: mixed) → array
The checks scripts have raised on this file: a list of {field, row, code, message, by_name, at}. row is null for a header field.
clearCheck
Section titled “clearCheck”captur.clearCheck(file: mixed, field: mixed, options?: array) → int
Clear this script’s check on a value: the one with code, or all of this script’s checks on that value when no code is given.
mash.captur.clearCheck(file, “Unit price”, {row: 3, code: “price”})
Clearing the last check does not close an open review request: a person decides that. Returns how many checks were cleared.
extract
Section titled “extract”captur.extract(file: File, options?: array) → array
Run Captur intelligent extraction on a file synchronously.
options.force: bool re-extract even when the file already has cached captur field values (default false).
Returns: {success, source: “cached”|“extracted”, written, fields, pages_processed}.
captur.queue(file: File) → array
Queue Captur extraction for a file. Returns immediately.