var itemArray = XXXXX
var nodes = document.editors[0].selectedNodes
if(nodes.length == 1){
var alert = new Alert("Item Placement", "Should the list items be added as children or siblings of the selected outline item?")
alert.addOption("Children")
alert.addOption("Siblings")
alert.addOption("Cancel")
alert.show(function(result){
var selectedItem = nodes[0].object
if (result == 0){
for(i = 0; i < itemArray.length; i++){
selectedItem.addChild(selectedItem.end,function(item){item.topic = itemArray[i]})
}
} else if (result == 1){
parentItem = selectedItem.parent
for(i = 0; i < itemArray.length; i++){
parentItem.addChild(parentItem.end,function(item){item.topic = itemArray[i]})
}
} else {
throw new Error('script cancelled')
}
})
} else {
var alert = new Alert('SELECTION ERROR','Please select a single outline item at which you wish to add items.')
alert.show(function(result){})
}
Common Lists
TAP | CLICK a list to transfer it to the current OmniOutliner document. (docs)