I am looking for a keyboard shortcut to collapse all rows of the level that i am currently on.
For example, If i have a level 3 selected in my outline it collapses so that only level 1, 2 and 3 are expanded in the entire outline instead of only that particular level three items children.
I use this AppleScript and run it via a keyboard shortcut in Keyboard Maestro. The same could be done in FastScripts or Launcher. It collapses the outline to the currently selected row level.
tell application "OmniOutliner"
tell front document
set max_level to count of level styles
set answer to display dialog "Show levels: (1-" & max_level & ")" default answer "1"
set new_level to text returned of answer as integer
if new_level > 0 and new_level †max_level then
set expanded of every row where level â„ new_level to false
set expanded of every row where level < new_level to true
end if
end tell
end tell
You can copy-paste this short script into a âRun AppleScriptâ action in an Automator Service (if youâre not familiar do a search on Automator Service) and attach a keyboard shortcut in System Preferences > Keyboard > Shortcuts. Just as if it were baked into app. Select a row and type the shortcut. No need to buy other programs.
SG
tell application "OmniOutliner"
tell front document
set thisLevel to first selected row's level
set (rows whose level â„ thisLevel)'s expanded to false
set (rows whose level < thisLevel)'s expanded to true
end tell
end tell
Thanks for reminding me of another way to implement the script. It is a good script. However, a deeper integration would be useful for both novice and power users. For example, Command+1= expand to level 1, Command+2= expand to level 2, etc.
Did you try âOptionâ + âCommandâ + â9â? (to Expand) or +â0â to collapse. Can be customized under âOmniOutlinerâ -> âKeyboard Shortcutsâ.