Last active
January 14, 2018 17:23
-
-
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 )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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