Keyboard Shortcut For Collapse or Expand All Rows of This Level



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


I think this would be enormously helpful to have baked into the app. I use it all all the time.


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.


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.

I use iThoughts and this is built in.


Did OO 5 do integrate this?


Did you try “Option” + “Command” + “9”? (to Expand) or +“0” to collapse. Can be customized under “OmniOutliner” -> “Keyboard Shortcuts”.

Does that do at least some of what you want?