CaseLeaf

Handbook / The `gather` command

The gather command

Sixty returned engagement letters are sitting in a folder and you need the answers in one spreadsheet.

Turns many filled copies of a form into one table. It is what makes sending out a form worthwhile: fifty returns become one file you can sort, and the alternative is opening fifty documents and typing. Reach for answers when you want to read one return, and this when you want all of them side by side.

How you run it

caseleaf gather first.pdf --with second.pdf,third.pdf --to table.csv

What each part means

In full, every part it will take:

caseleaf gather <first.pdf> --with <second.pdf,third.pdf> --to <table.csv>
part what it is for
<file> The PDF to work on, as a path, such as report.pdf beside you, or the full path to it. It is read and not written.
--with The other filled copies, as paths separated by commas, such as second.pdf,third.pdf. Every copy is expected to be the same form; a field one of them lacks comes back empty rather than shifting the column.
--to Where to write the table, as a path ending .csv, such as returns.csv. One row per document and one column per field, under a first column called document that names the file each row came from. A form a field short still lines up: the cell is empty, the column does not move.

A row per document, a column per field.

What comes back

Asked of a short sample document, it answers as below. The sample has eight sheets, a highlight and a note left by a reviewer, a web link, a small table, two pictures and one form field already filled in.

{
  "documents" : 3,
  "fields" : 1,
  "written" : true
}

The same thing from AppleScript

Everything above can be asked for from a script instead. There is one AppleScript command, perform: on names the document, and options takes the rest exactly as you would type it.

tell application "CaseLeaf"
    perform "gather" on "/path/to/first.pdf" ¬
        options "--with second.pdf,third.pdf --to table.csv"
end tell

All the commands · Asking from a script · Contents