In examples.Sample Outline 2, position the bar cursor on "Subhead 1, Summit" and then double-click its item marker to collapse it (or execute "op.collapse ()" in the QuickScript window to accomplish the same thing). Now execute:
op.expand (1)
» true
The three main subheads under Subhead 1 appear on the display, while the subheads under "Subhead 1.1" remain hidden.
Leaving the cursor where it is, execute:
op.expand (3)
» true
Now all of Subhead 1's subheads are visible.
In examples.Sample Outline 2, position the cursor at the summit and double-click its item marker to collapse the outline (or execute "op.collapse ()" in the QuickScript window to accomplish the same thing). Now execute:
op.expand (infinity)
» true
As in many situations in Frontier, you can use the special keyword "infinity" when you aren't sure how many levels of subheads might exist beneath the present heading. In this case, the entire outline expands. Leaving the cursor at the summit, execute:
op.expand (1)
» false
This time, nothing happens and the function returns false because there are no hidden subheads below the summit.