Skip to content

Instantly share code, notes, and snippets.

@colinf
Last active January 14, 2018 17:23
Show Gist options
  • Save colinf/7359f36b23cb678a1c65e78f4f757f88 to your computer and use it in GitHub Desktop.
Save colinf/7359f36b23cb678a1c65e78f4f757f88 to your computer and use it in GitHub Desktop.
Reading the top level rows of an outline ( see https://medium.com/@softwarecf/a-faint-outline-2a2c641d6492 )
function readRows () {
let oo = Application('OmniOutliner')
let doc = oo.documents[0]
let rows = doc.children
let idList = rows.id()
let nameList = rows.name()
let hasChildrenList = rows.hasSubtopics()
return idList.map((id, i) => {
return {id, name: nameList[i], hasChildren: hasChildrenList[i]}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment