CaseLeaf

Handbook / The `links` command

The links command

The contents page of a two-hundred-page bundle has stopped taking people to the right sections, and nobody knows which links broke.

Lists every link in the document, where each one sits, and where it goes: to a sheet of this document, to a web address, or nowhere at all. That last group is why this exists, because a link that points at nothing looks identical to a working one until somebody clicks it. Reach for it when checking a document before it goes out, and when a contents page has stopped taking readers to the right place.

How you run it

caseleaf links report.pdf

What each part means

In full, every part it will take:

caseleaf links <file>

The document, and nothing else.

Each link's page, rectangle, and whether it goes to a sheet of this document, to a web address, or to nothing at all.

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.

{
  "kinds" : {
    "nowhere" : 0,
    "sheet" : 0,
    "web" : 1
  },
  … and the rest of the answer

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

All the commands · Asking from a script · Contents