CaseLeaf

Handbook / The `tags` command

The tags command

A review has two hundred marks on it and you need to know how many are still waiting on counsel.

Lists the tags the marks carry and what carries each. Tags are how a long review gets sorted, with everything marked for counsel kept apart from everything still open, and this is how that sorting is read back out. Use it to count what is outstanding, or to pull one thread out of a document with two hundred marks on it.

How you run it

caseleaf tags report.pdf

caseleaf tags report.pdf --tag Reviewer --adopt

What each part means

In full, every part it will take:

caseleaf tags <file> [--tag <name>] [--adopt]
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.
--tag List only the marks carrying this tag, such as --tag followup, written without the leading hash. Left out, every tag in the document is reported with a count.
--adopt Add this document's tags to your own vocabulary, so they are offered as suggestions on every document afterwards. It changes your settings, not the document, and it adds: a tag you already have is left as it is, and the ones you had are kept. The answer says handedOver, which is whether the settings actually took them.

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.

{
  "count" : 1,
  "tags" : [
    {
      "marks" : 1,
      "tag" : "followup"
    }
  ]
}

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 "tags" on "/path/to/report.pdf"
end tell

tell application "CaseLeaf"
    perform "tags" on "/path/to/report.pdf" ¬
        options "--tag Reviewer --adopt"
end tell

All the commands · Asking from a script · Contents