Creating a document based on the higher levels only

Hopefully an example of what I’m trying to do will help: ’ve written a lecture with detailed notes and want to share the overall structure with my students contained in the headings but not the details that I’ll be talking about, which are mostly cryptic notes to myself. Ideally, I’d like to post this upper-level outline as a text-based document that’s easy to access and can be imported to a wide variety of word processors.

I see that the issue is discussed here: Export outline only to a certain level of rows but I’ve never done script so I’m totally embarrassed to ask even where to put it. I’d appreciate it if some kind person could break this down into individual steps for a blushing novice.

Thanks much!

Not knowing what the heck to do with a script to run it is a common problem!

To start try opening Script Editor in your Applications > Utilities folder, then simply copying and pasting a script into that. With the OO document open and (for some of the scripts) a row selected, simply click the ‘triangle’ run button in Script Editor. That’s it!

If a script turns out to do what you want and you think you will use it then there are ways to activate a Script menu at the top of your screen and put the script in there so it becomes like any other menu pick. But first get a script to do what you want before trying that.

I quickly tried the first and scripts in the thread you referenced, and I’m not sure they do exactly what you describe. They seem to collapse the outline to a certain level but leave the lower level rows in the document. It may be necessary to have the script actually delete rows with collapsed parents (in a copy, not the original of course!). But try them out. It’s basically copy, paste, click.


If you want to keep things simple you could try this short script on a COPY of your working document that you’ve made via File > Duplicate. Select a row in the duplicate that is the highest level that you DON’T want to distribute and click ‘run’. Then use File > Export on the duplicate to produce the format you want.

-- select row in highest unwanted level in a COPY of your document and run
tell application "OmniOutliner"
	tell front document
		set rowCount to row count
		set deleteLevel to first selected row's level
		repeat with i from rowCount to 1 by -1
			tell row i to if its level is deleteLevel then delete it
		end repeat
	end tell
end tell

Thanks so much - this could be really helpful. But my naïvete about scripts extends to just learning that I’m not a pro user, and paying $50 to test this out seems extreme. Perhaps version 5 will make pro a more attractive option - from what I can tell the ability to export to MS Word in version 4 isn’t that great, which is the only other advantage I see in doing this. If there’s some other workaround, I’d love to know. Thanks for your time though - I really appreciate it.

You could download the beta and try the script with that. The new version in beta has filters, which are pretty sweet.

Forgot to mention that if you haven’t yet run scripts on your machine then make sure Script is checked at System Preferences > Security & Privacy > Privacy > Accessibility.

Don’t let scripts intimidate. Writing one isn’t easy. But using one that is already written is copy-paste-click easy, and can save you a lot if work. You’ll know whether this does what you want in a minute or two.