Whole Document Style

The whole document style is a collection of style attribute settings that when set, are applied to all text in an OmniOutliner outline document. The whole document style is represented in the scripting implementation by the outline property: baseStyle.

Base Style

The baseStyle property of the outline class is the default style used for the whole outline document.

Using the get(Style.Attribute) and set(Style.Attribute, value) methods of the style class you can retrieve and change styling characteristics shared by all elements of the document.

For example, here is how to retrieve the default RGB color value of the font fill color of the base style:

var color = document.outline.baseStyle.get(Style.Attribute.FontFillColor) console.log([color.red, color.green, color.blue])

(Documentation concerning the Color class is available here.)

And an example of changing the default font color to red:

document.outline.baseStyle.set(Style.Attribute.FontFillColor, Color.red)
omnioutliner:///omnijs-run?script=document%2Eoutline%2EbaseStyle%2Eset%28Style%2EAttribute%2EFontFillColor%2C%20Color%2Ered%29

Removing Added Style Attributes

The clear() instance method removes all the locally applied style attribute values for a Style, even the Style representing the value of the baseStyle property.

document.outline.baseStyle.clear()
omnioutliner:///omnijs-run?script=document%2Eoutline%2EbaseStyle%2Eclear%28%29

Setting Attributes of the Base Style of a New Document

The baseStyle property and the clear() and set() methods can be used when creating new documents:

Document.makeNewAndShow(function(doc){ baseItem = doc.editors[0].rootNode.object baseItem.addChild(null,function(item){item.topic = 'HELLO WORLD'}) doc.outline.baseStyle.clear() doc.outline.baseStyle.set(Style.Attribute.FontFillColor, Color.red) })
omnioutliner:///omnijs-run?script=Document%2EmakeNewAndShow%28function%28doc%29%7B%0A%09coreItem%20%3D%20doc%2Eeditors%5B0%5D%2ErootNode%2Eobject%0A%09coreItem%2EaddChild%28null%2Cfunction%28item%29%7Bitem%2Etopic%20%3D%20%27HELLO%20WORLD%27%7D%29%0A%09doc%2Eoutline%2EbaseStyle%2Eclear%28%29%0A%09doc%2Eoutline%2EbaseStyle%2Eset%28Style%2EAttribute%2EFontFillColor%2C%20Color%2Ered%29%0A%7D%29

Column Title Style

The value of the columnTitleStyle property of an outline is a style used to determine the manner in which the titles of the columns are displayed. You can access and change the attributes of that style.

titleStyle = document.outline.columnTitleStyle titleStyle.clear() titleStyle.set(Style.Attribute.FontFamily, 'Helvetica Neue') titleStyle.set(Style.Attribute.FontSize, 18) titleStyle.set(Style.Attribute.FontWeight, 5) titleStyle.set(Style.Attribute.FontFillColor, Color.black) titleStyle.set(Style.Attribute.KerningAdjustment, 1) titleStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Left)
omnioutliner:///omnijs-run?script=titleStyle%20%3D%20document%2Eoutline%2EcolumnTitleStyle%0AtitleStyle%2Eclear%28%29%0AtitleStyle%2Eset%28Style%2EAttribute%2EFontFamily%2C%20%27Helvetica%20Neue%27%29%0AtitleStyle%2Eset%28Style%2EAttribute%2EFontSize%2C%2018%29%0AtitleStyle%2Eset%28Style%2EAttribute%2EFontWeight%2C%205%29%0AtitleStyle%2Eset%28Style%2EAttribute%2EFontFillColor%2C%20Color%2Eblack%29%0AtitleStyle%2Eset%28Style%2EAttribute%2EKerningAdjustment%2C%201%29%0AtitleStyle%2Eset%28Style%2EAttribute%2EParagraphAlignment%2C%20TextAlignment%2ELeft%29

Notes Style

The Notes style is attached to the Notes field and can be adjusted in the same manner as any other style. Here’s a script for setting the style attributes for the Notes field:

notesStyle = document.outline.noteColumn.style notesStyle.clear() notesStyle.set(Style.Attribute.FontFamily, 'Avenir Next') notesStyle.set(Style.Attribute.FontSize, 14) notesStyle.set(Style.Attribute.FontWeight, 3) notesStyle.set(Style.Attribute.FontItalic, true) notesStyle.set(Style.Attribute.FontFillColor, Color.RGB(0,0.5603182912,0)) notesStyle.set(Style.Attribute.KerningAdjustment, 0) notesStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Left)
omnioutliner://localhost/omnijs-run?script=notesStyle%20%3D%20document%2Eoutline%2EnoteColumn%2Estyle%0AnotesStyle%2Eclear%28%29%0AnotesStyle%2Eset%28Style%2EAttribute%2EFontFamily%2C%20%27Avenir%20Next%27%29%0AnotesStyle%2Eset%28Style%2EAttribute%2EFontSize%2C%2014%29%0AnotesStyle%2Eset%28Style%2EAttribute%2EFontWeight%2C%203%29%0AnotesStyle%2Eset%28Style%2EAttribute%2EFontItalic%2C%20true%29%0AnotesStyle%2Eset%28Style%2EAttribute%2EFontFillColor%2C%20Color%2ERGB%280%2C0%2E5603%2C0%29%29%0AnotesStyle%2Eset%28Style%2EAttribute%2EKerningAdjustment%2C%200%29%0AnotesStyle%2Eset%28Style%2EAttribute%2EParagraphAlignment%2C%20TextAlignment%2ELeft%29

Topic Column Style

Setting the style assigned to the Topic column.

topicStyle = document.outline.outlineColumn.style topicStyle.clear() topicStyle.set(Style.Attribute.FontFamily, 'Avenir Next') topicStyle.set(Style.Attribute.FontSize, 18) topicStyle.set(Style.Attribute.FontWeight, 5) topicStyle.set(Style.Attribute.FontItalic, false) topicStyle.set(Style.Attribute.FontFillColor, Color.darkGray) topicStyle.set(Style.Attribute.KerningAdjustment, -0.5) topicStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Left)
omnioutliner://localhost/omnijs-run?script=topicStyle%20%3D%20document%2Eoutline%2EoutlineColumn%2Estyle%0AtopicStyle%2Eclear%28%29%0AtopicStyle%2Eset%28Style%2EAttribute%2EFontFamily%2C%20%27Avenir%20Next%27%29%0AtopicStyle%2Eset%28Style%2EAttribute%2EFontSize%2C%2018%29%0AtopicStyle%2Eset%28Style%2EAttribute%2EFontWeight%2C%205%29%0AtopicStyle%2Eset%28Style%2EAttribute%2EFontItalic%2C%20false%29%0AtopicStyle%2Eset%28Style%2EAttribute%2EFontFillColor%2C%20Color%2EdarkGray%29%0AtopicStyle%2Eset%28Style%2EAttribute%2EKerningAdjustment%2C%20%2D0%2E5%29%0AtopicStyle%2Eset%28Style%2EAttribute%2EParagraphAlignment%2C%20TextAlignment%2ELeft%29
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