View Single Post
I'm using version 3.6.5/final-v143.28, but your question about how I'm doing it is a good one. I'm using a toolbar icon for the AppleScript "Collapse to Level X".

Upon reading your response I tried it with the menu commands "Expand All" or "Collapse All" and found they behaved properly; i.e., they expanded or collapsed only in the current view, leaving other views intact.

I'm wondering if the AppleScript and the latest OO upgrade have some inconsistency.

The script is as follows:

tell application "OmniOutliner Professional"
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