The sample scripts on the OmniOutliner Extras page include:
It is easier for me to simply:
This is the pair of scripts which I use:
Expand one level more:
Collapse one level more:
- Collapse to Level of Selected Item,
- and Collapse to Level X
It is easier for me to simply:
- Expand a little,
- Collapse a little.
This is the pair of scripts which I use:
Expand one level more:
Code:
property plstLevel : {} AdjustExpansion(1) set plstLevel to {} on AdjustExpansion(lngDelta) tell application id "com.omnigroup.OmniOutlinerPro3" if (count of documents) < 1 then return set oDoc to front document set lngNewMax to (my DeepestLevel(oDoc, true)) + lngDelta tell oDoc set expanded of (rows where level ≤ lngNewMax) to true set expanded of (rows where level > lngNewMax) to false end tell end tell end AdjustExpansion on DeepestLevel(oDoc, blnExpandedOnly) set lngMax to 0 using terms from application "OmniOutliner Professional" if blnExpandedOnly then set plstLevel to level of rows of oDoc where expanded is true else set plstLevel to level of rows of oDoc end if repeat with iLevel from 1 to length of plstLevel set lngLevel to item iLevel of plstLevel if lngLevel > lngMax then set lngMax to lngLevel end repeat end using terms from lngMax as integer end DeepestLevel
Code:
property plstLevel : {} AdjustExpansion(-1) set plstLevel to {} on AdjustExpansion(lngDelta) tell application id "com.omnigroup.OmniOutlinerPro3" if (count of documents) < 1 then return set oDoc to front document set lngNewMax to (my DeepestLevel(oDoc, true)) + lngDelta tell oDoc set expanded of (rows where level ≤ lngNewMax) to true set expanded of (rows where level > lngNewMax) to false end tell end tell end AdjustExpansion on DeepestLevel(oDoc, blnExpandedOnly) set lngMax to 0 using terms from application "OmniOutliner Professional" if blnExpandedOnly then set plstLevel to level of rows of oDoc where expanded is true else set plstLevel to level of rows of oDoc end if repeat with iLevel from 1 to length of plstLevel set lngLevel to item iLevel of plstLevel if lngLevel > lngMax then set lngMax to lngLevel end repeat end using terms from lngMax as integer end DeepestLevel
Last edited by RobTrew; 2010-11-05 at 12:50 AM.. Reason: Tidied the code a little