OmniOutliner OPML to Markdown

This script takes an OPML file exported from OmniOutliner and turns it into a markdown file with the specified depth of headings. Use the share sheet in OmniOutliner to copy the OPML file to Drafts, then run the action.

Lines with a depth greater than the maximum heading depth are converted to markdown lists with the appropriate level of indentation.

Currently does not support notes. Pull requests welcome.

1 Like

This is great. Would it be hard to add handling of notes and status tags? notes -> md block quote

FYI, Omni Automation, which is the dual-platform (iOS/macOS) JavaScript automation implementation in OmniGraffle and OmniOutliner, can be used to quickly transfer data from those apps into Drafts.

Cheers – Sal


Thanks Sal. I’ve learned a lot of JavaScript from scripting in Drafts, so my next project is to play around with the Omni automation stuff.

Thanks for making this script. It works for some simple outlines I have, but some more complex ones are giving me this error:

Script Error: RangeError: String.prototype.repeat argument 
must be greater than or equal to 0 and not be Infinity

Line number: 43, Column 39

I’ve looked through the outlines and don’t think there’s anything unusual about them particularly. Any ideas?