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])
Get Value of Whole Document Style Attribute
Copy Script
01 var color = document .outline .baseStyle .get (Style .Attribute .FontFillColor )
02 console .log ([color .red , color .green , color .blue ])
03
(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
Set Value of Whole Document Style Attribute
Copy Script Run Script
01 document .outline .baseStyle .set (Style .Attribute .FontFillColor , Color .red )
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
Removing Added Style Attributes
Copy Script Run Script
01 document .outline .baseStyle .clear ()
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
New Document
Copy Script Run Script Web Console
01 Document .makeNewAndShow (function (doc ){
02 baseItem = doc .editors [0].rootNode .object
03 baseItem .addChild (null ,function (item ){item .topic = 'HELLO WORLD' })
04 doc .outline .baseStyle .clear ()
05 doc .outline .baseStyle .set (Style .Attribute .FontFillColor , Color .red )
06 })
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
Setting Style of Column Titles
Copy Script Run Script Web Console
01 titleStyle = document .outline .columnTitleStyle
02 titleStyle .clear ()
02 titleStyle .set (Style .Attribute .FontFamily , 'Helvetica Neue' )
03 titleStyle .set (Style .Attribute .FontSize , 18)
04 titleStyle .set (Style .Attribute .FontWeight , 5)
05 titleStyle .set (Style .Attribute .FontFillColor , Color .black )
06 titleStyle .set (Style .Attribute .KerningAdjustment , 1)
07 titleStyle .set (Style .Attribute .ParagraphAlignment , TextAlignment .Left )
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
Setting Style of Notes
Copy Script Run Script Web Console
01 notesStyle = document .outline .noteColumn .style
02 notesStyle .clear ()
03 notesStyle .set (Style .Attribute .FontFamily , 'Avenir Next' )
04 notesStyle .set (Style .Attribute .FontSize , 14)
05 notesStyle .set (Style .Attribute .FontWeight , 3)
06 notesStyle .set (Style .Attribute .FontItalic , true )
07 notesStyle .set (Style .Attribute .FontFillColor , Color .RGB (0,0.5603,0))
08 notesStyle .set (Style .Attribute .KerningAdjustment , 0)
09 notesStyle .set (Style .Attribute .ParagraphAlignment , TextAlignment .Left )
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
Topic Column Style
Copy Script Run Script Web Console
01 topicStyle = document .outline .outlineColumn .style
02 topicStyle .clear ()
03 topicStyle .set (Style .Attribute .FontFamily , 'Avenir Next' )
04 topicStyle .set (Style .Attribute .FontSize , 18)
05 topicStyle .set (Style .Attribute .FontWeight , 5)
06 topicStyle .set (Style .Attribute .FontItalic , false )
07 topicStyle .set (Style .Attribute .FontFillColor , Color .darkGray )
08 topicStyle .set (Style .Attribute .KerningAdjustment , -0.5)
09 topicStyle .set (Style .Attribute .ParagraphAlignment , TextAlignment .Left )
TOPICS
Home
OmniOutliner
Document
Outline
Item
Editor
Style
Whole Document
Level Styles
Named Styles
Style Links
Text
App-to-App
Scripting Dictionary
Action Template
OmniGraffle
OmniPlan
OmniFocus
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
Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. OMNI-AUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. OMNI-AUTOMATION.COM provides this only as a convenience to our users. OMNI-AUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and OMNI-AUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from OMNI-AUTOMATION.COM and that OMNI-AUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.