Outline

The Outline lies at the heart of everything you do in OmniOutliner. It’s where you compose and arrange content, it reflects the styles you choose with the Sidebar and Inspectors, and it is built on a hierarchy of rows that gives exactly the structure you want for your data.

An outline in OmniOutliner Pro is composed of one or more rows and one or more columns, with data entered into the cells created by their intersection. The Topic column can additionally display rows in hierarchy, offering the ability to create sophisticated outline structures.

Outline Properties

Here are the properties of an instance of the Outline class:

Getting an array of the identifiers of the plugIns available to use with the outline:

document.outline.plugIns.map(plugin => {return plugin.identifier})

Getting an array of the display names of the plugIns available to use with the outline:

document.outline.plugIns.map(plugin => {return plugin.displayName})

Outline Methods (functions)

Here are methods for use with an instance of the Outline class:

As an example, assume you have a document with a enumeration column named “Type”. Use of the organize function will rearrange the leaf items into groups based on their value in the Type column. Any previously created Type groups that have no entries will be removed.

Group | Ungroup

The group() and ungroup() methods enable the creation and dissolution of item parent/child groups.

editor = document.editors[0] sel = editor.selectedNodes.map(function(node){return node.object}) newItem = document.outline.group(sel) newItem.topic = "NEW ITEM"
group-before-after
editor = document.editors[0] sel = editor.selectedNodes.map(function(node){return node.object}) document.outline.ungroup(sel)
ungroup-before-after

Top Items

Given an array of Items in an Outline, return the subset of Items that are not descendants of some other element of the array.

The following script shows which of the selected items are top items by appending the string “<-- TOP ITEM” to the each of the top items.

top-items-before
editor = document.editors[0] sel = editor.selectedNodes.map(function(node){return node.object}) tItems = document.outline.topItems(sel) tItems.forEach(function(item){ item.topic = item.topic + ' <-- TOP ITEM' })
omnioutliner://localhost/omnijs-run?script=editor%20%3D%20document%2Eeditors%5B0%5D%0Asel%20%3D%20editor%2EselectedNodes%2Emap%28function%28node%29%7Breturn%20node%2Eobject%7D%29%0AtItems%20%3D%20document%2Eoutline%2EtopItems%28sel%29%0AtItems%2EforEach%28function%28item%29%7B%0A%09item%2Etopic%20%3D%20item%2Etopic%20%2B%20%27%20%3C--%20TOP%20ITEM%27%0A%7D%29
top-items-after

Bottom Items

Given an array of Items in this Outline, return the subset of Items that are not ancestors of some other element of the array.

The following script shows which of the selected items are bottom items by appending the string “<-- BOTTOM ITEM” to the each of the bottom items.

top-items-before
editor = document.editors[0] sel = editor.selectedNodes.map(function(node){return node.object}) bItems = document.outline.bottomItems(sel) bItems.forEach(function(item){ item.topic = item.topic + ' <-- BOTTOM ITEM' })
omnioutliner://localhost/omnijs-run?script=editor%20%3D%20document%2Eeditors%5B0%5D%0Asel%20%3D%20editor%2EselectedNodes%2Emap%28function%28node%29%7Breturn%20node%2Eobject%7D%29%0AbItems%20%3D%20document%2Eoutline%2EbottomItems%28sel%29%0AbItems%2EforEach%28function%28item%29%7B%0A%09item%2Etopic%20%3D%20item%2Etopic%20%2B%20%27%20%3C--%20BOTTOM%20ITEM%27%0A%7D%29
bottom-items-after

Items Sorted by Position

Given an array of Items in an Outline, return a sorted array of those Items as they are ordered in the Outline’s item tree.

The following script shows the position of each of the selected items by appending the string “<-- (position index)” to the each of the items.

top-items-before
editor = document.editors[0] sel = editor.selectedNodes.map(function(node){return node.object}) sItems = document.outline.itemsSortedByPosition(sel) sItems.forEach(function(item,index,array){ item.topic = item.topic + ' <-- ' + String(index) })
omnioutliner://localhost/omnijs-run?script=editor%20%3D%20document%2Eeditors%5B0%5D%0Asel%20%3D%20editor%2EselectedNodes%2Emap%28function%28node%29%7Breturn%20node%2Eobject%7D%29%0AsItems%20%3D%20document%2Eoutline%2EitemsSortedByPosition%28sel%29%0AsItems%2EforEach%28function%28item%2Cindex%2Carray%29%7B%0A%09item%2Etopic%20%3D%20item%2Etopic%20%2B%20%27%20%3C--%20%27%20%2B%20String%28index%29%0A%7D%29
items-by-position

Organize Items

The organize() function of the Outline class rearranges the item trees rooted at items based on the values in the specified columns (converted to a string representation), and places those items under the specified new parent item. Any items moving to the new parent will be placed at the end of the parent item. If the prune empty groups parameter is true, any children of underItem that end up empty will be removed.

Here’s an example of the use of the organize() method. The outline contains 500 items, each containing the name, email address, state of residence, and number of purchases by each customer. The example script will organize the items by state and the number of purchases.

Download the example outline file.

organize-before
tree = document.outline tree.organize( rootItem.leaves, [columns.byTitle("State"),columns.byTitle("Buys")], rootItem, true )
organize-after
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER