CaseLeaf

Handbook / The `ungroup` command

The ungroup command

One mark in an exhibit needs to move on its own, and the rest of the group should stay where they are.

Takes a group apart, one level. It undoes what group did, the outermost level first: a group nested inside another is left standing, so taking a bundle of exhibits apart does not scatter the pages inside each exhibit too.

How you run it

caseleaf ungroup report.pdf --mark 27583BEA-15F6-4C8E-9B67-C910F80DB6F1

What each part means

In full, every part it will take:

caseleaf ungroup <file> --mark <id>
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. This command writes to it, so keep a copy if the original matters.
--mark Any one mark in the group, by the identifier marks prints for it. The outermost group it belongs to comes apart; a group nested further inside it is left standing.

Takes off the outermost group that mark is in; a group nested further in is left standing.

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.

{
  "marks" : [
    "8C7A21E0-0000-4000-8000-000000000000",
    "8C7A21E0-0000-4000-8000-000000000000"
  ],
  "ungrouped" : "8C7A21E0-0000-4000-8000-000000000000"
}

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 "ungroup" on "/path/to/report.pdf" ¬
        options "--mark 27583BEA-15F6-4C8E-9B67-C910F80DB6F1"
end tell

All the commands · Asking from a script · Contents