OO-PG0002

Plug-In: Apply Dark/Light Styling

One of the benefits of automation is the flexibility it brings to how you interact with the software you use daily to accomplish your goals. With the power of automation, the document you created using a specific styled template can quickly and easily change its appearance to suit your needs and requirements.

These two plug-ins are examples of tools that can change a document’s look-and-feel, by altering the various available style attributes. In designing such plug-ins you can choose which attributes to changes, such as font fill color, or font family and size.

Return to: OmniOutliner Plug-In Collection

Apply Dark Styling
 

/*{ "type": "action", "targets": ["omnioutliner"], "author": "Otto Automator", "identifier": "com.omni-automation.oo.apply-dark-styling", "version": "1.0", "description": "Applies sets of dark styles to the current document.", "label": "Apply Dark Styling", "shortLabel": "Apply Dark Styles", "paletteLabel": "Apply Dark Styles", "image": "wand.and.stars" }*/ (() => { const action = new PlugIn.Action(async function(selection, sender){ try { var baseBckgndColor = Color.RGB(0.1569, 0.1569, 0.1569, 1) // #282828 var baseFontFamily = "Helvetica Neue" var baseFontColor = Color.RGB(1, 1, 1, 1) var statusFontColor = Color.White(.9, 1) var titleFontColor = Color.White(.1, 1) var titleBckgndColor = Color.RGB(0.8, 0.8, 0.8, 1) var notesFontColor = Color.RGB(0.8, 0.8, 0.8, 1) var lvlOneFontColor = Color.RGB(1, 1, 1, 1) var lvlTwoFontColor = Color.RGB(.9, .9, .9, 1) var lvlThreeFontColor = Color.RGB(.9, .9, .9, 1) var lvlFourFontColor = Color.RGB(.9, .9, .9, 1) document.outline.baseStyle.clear() document.outline.baseStyle.set(Style.Attribute.BackgroundColor, baseBckgndColor) document.outline.baseStyle.set(Style.Attribute.FontFillColor, baseFontColor) document.outline.baseStyle.set(Style.Attribute.FontFamily, baseFontFamily) document.outline.baseStyle.set(Style.Attribute.FontSize, 19) document.outline.baseStyle.set(Style.Attribute.FontWeight, 4) // Book document.outline.baseStyle.set(Style.Attribute.ParagraphHeadIndent, 8) document.outline.baseStyle.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) document.outline.baseStyle.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) document.outline.baseStyle.set(Style.Attribute.ParagraphLineSpacing, null ) titleStyle = document.outline.columnTitleStyle titleStyle.clear() titleStyle.set(Style.Attribute.BackgroundColor, titleBckgndColor) titleStyle.set(Style.Attribute.FontFamily, baseFontFamily) titleStyle.set(Style.Attribute.FontSize, 22) titleStyle.set(Style.Attribute.FontWeight, 7) // Demi-Bold titleStyle.set(Style.Attribute.FontFillColor, titleFontColor) titleStyle.set(Style.Attribute.KerningAdjustment, null) titleStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Left) titleStyle.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) titleStyle.set(Style.Attribute.ParagraphLineHeightMultiple, 1.25) statusStyle = document.outline.statusColumn.style statusStyle.clear() statusStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Center) statusStyle.set(Style.Attribute.FontFillColor, statusFontColor) statusStyle.set(Style.Attribute.BackgroundColor, baseBckgndColor) notesStyle = document.outline.noteColumn.style notesStyle.clear() notesStyle.set(Style.Attribute.BackgroundColor, baseBckgndColor) notesStyle.set(Style.Attribute.FontFamily, baseFontFamily) notesStyle.set(Style.Attribute.FontSize, 16) notesStyle.set(Style.Attribute.FontWeight, 3) // Light notesStyle.set(Style.Attribute.FontItalic, true) notesStyle.set(Style.Attribute.FontFillColor, notesFontColor) notesStyle.set(Style.Attribute.KerningAdjustment, null) notesStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Left) notesStyle.set(Style.Attribute.ParagraphSpacingBefore, 12) // Points notesStyle.set(Style.Attribute.ParagraphLineSpacing, 2) notesStyle.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) notesStyle.set(Style.Attribute.ParagraphHeadIndent, 8) notesStyle.set(Style.Attribute.ParagraphLineHeightMultiple, 1.25) notesStyle.set(Style.Attribute.ParagraphMaximumLineHeight, null) notesStyle.set(Style.Attribute.ParagraphMinimumLineHeight, null) notesStyle.set(Style.Attribute.ParagraphTailIndent, 24) notesStyle.set(Style.Attribute.ParagraphDefaultTabInterval, 36) notesStyle.set(Style.Attribute.ParagraphTabStops,"36R,48L") // Numeric levelStyleOne = document.outline.levelStyle(0) levelStyleOne.clear() levelStyleOne.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleOne.set(Style.Attribute.FontFillColor, lvlOneFontColor) levelStyleOne.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleOne.set(Style.Attribute.FontSize, 19) levelStyleOne.set(Style.Attribute.FontWeight, 4) // Regular levelStyleOne.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleOne.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleOne.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleOne.set(Style.Attribute.ParagraphLineSpacing, null) levelStyleTwo = document.outline.levelStyle(1) levelStyleTwo.clear() levelStyleTwo.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleTwo.set(Style.Attribute.FontFillColor, lvlTwoFontColor) levelStyleTwo.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleTwo.set(Style.Attribute.FontSize, 18) levelStyleTwo.set(Style.Attribute.FontWeight, 4) // Regular levelStyleTwo.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleTwo.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleTwo.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleTwo.set(Style.Attribute.ParagraphLineSpacing, null) levelStyleThree = document.outline.levelStyle(2) levelStyleThree.clear() levelStyleThree.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleThree.set(Style.Attribute.FontFillColor, lvlThreeFontColor) levelStyleThree.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleThree.set(Style.Attribute.FontSize, 18) levelStyleThree.set(Style.Attribute.FontWeight, 4) // Regular levelStyleThree.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleThree.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleThree.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleThree.set(Style.Attribute.ParagraphLineSpacing, null) levelStyleFour = document.outline.levelStyle(2) levelStyleFour.clear() levelStyleFour.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleFour.set(Style.Attribute.FontFillColor, lvlFourFontColor) levelStyleFour.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleFour.set(Style.Attribute.FontSize, 18) levelStyleFour.set(Style.Attribute.FontWeight, 4) // Regular levelStyleFour.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleFour.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleFour.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleFour.set(Style.Attribute.ParagraphLineSpacing, null) } catch(err){ console.error(err.name, err.message) } }); action.validate = function(selection, sender){ // validation code // selection options: columns, document, editor, items, nodes, outline, styles return true }; return action; })();
Apply Light Styling
 

/*{ "type": "action", "targets": ["omnioutliner"], "author": "Otto Automator", "identifier": "com.omni-automation.oo.apply-light-styling", "version": "1.0", "description": "Applies sets of light styles to the current document.", "label": "Apply Light Styling", "shortLabel": "Apply Light Styles", "paletteLabel": "Apply Light Styles", "image": "wand.and.stars" }*/ (() => { const action = new PlugIn.Action(async function(selection, sender){ try { var baseBckgndColor = Color.RGB(0.8431, 0.8431, 0.8431, 1) // #282828 var baseFontFamily = "Helvetica Neue" var baseFontColor = Color.RGB(0, 0, 0, 1) var statusFontColor = Color.White(.1, 1) var titleFontColor = Color.White(.9, 1) var titleBckgndColor = Color.RGB(0.2, 0.2, 0.2, 1) var notesFontColor = Color.RGB(0.2, 0.2, 0.2, 1) var lvlOneFontColor = Color.RGB(0, 0, 0, 1) var lvlTwoFontColor = Color.RGB(.1, .1, .1, 1) var lvlThreeFontColor = Color.RGB(.1, .1, .1, 1) var lvlFourFontColor = Color.RGB(.1, .1, .1, 1) document.outline.baseStyle.clear() document.outline.baseStyle.set(Style.Attribute.BackgroundColor, baseBckgndColor) document.outline.baseStyle.set(Style.Attribute.FontFillColor, baseFontColor) document.outline.baseStyle.set(Style.Attribute.FontFamily, baseFontFamily) document.outline.baseStyle.set(Style.Attribute.FontSize, 19) document.outline.baseStyle.set(Style.Attribute.FontWeight, 4) // Book document.outline.baseStyle.set(Style.Attribute.ParagraphHeadIndent, 8) document.outline.baseStyle.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) document.outline.baseStyle.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) document.outline.baseStyle.set(Style.Attribute.ParagraphLineSpacing, null ) titleStyle = document.outline.columnTitleStyle titleStyle.clear() titleStyle.set(Style.Attribute.BackgroundColor, titleBckgndColor) titleStyle.set(Style.Attribute.FontFamily, baseFontFamily) titleStyle.set(Style.Attribute.FontSize, 22) titleStyle.set(Style.Attribute.FontWeight, 7) // Demi-Bold titleStyle.set(Style.Attribute.FontFillColor, titleFontColor) titleStyle.set(Style.Attribute.KerningAdjustment, null) titleStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Left) titleStyle.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) titleStyle.set(Style.Attribute.ParagraphLineHeightMultiple, 1.25) statusStyle = document.outline.statusColumn.style statusStyle.clear() statusStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Center) statusStyle.set(Style.Attribute.FontFillColor, statusFontColor) statusStyle.set(Style.Attribute.BackgroundColor, baseBckgndColor) notesStyle = document.outline.noteColumn.style notesStyle.clear() notesStyle.set(Style.Attribute.BackgroundColor, baseBckgndColor) notesStyle.set(Style.Attribute.FontFamily, baseFontFamily) notesStyle.set(Style.Attribute.FontSize, 16) notesStyle.set(Style.Attribute.FontWeight, 3) // Light notesStyle.set(Style.Attribute.FontItalic, true) notesStyle.set(Style.Attribute.FontFillColor, notesFontColor) notesStyle.set(Style.Attribute.KerningAdjustment, null) notesStyle.set(Style.Attribute.ParagraphAlignment, TextAlignment.Left) notesStyle.set(Style.Attribute.ParagraphSpacingBefore, 12) // Points notesStyle.set(Style.Attribute.ParagraphLineSpacing, 2) notesStyle.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) notesStyle.set(Style.Attribute.ParagraphHeadIndent, 8) notesStyle.set(Style.Attribute.ParagraphLineHeightMultiple, 1.25) notesStyle.set(Style.Attribute.ParagraphMaximumLineHeight, null) notesStyle.set(Style.Attribute.ParagraphMinimumLineHeight, null) notesStyle.set(Style.Attribute.ParagraphTailIndent, 24) notesStyle.set(Style.Attribute.ParagraphDefaultTabInterval, 36) notesStyle.set(Style.Attribute.ParagraphTabStops,"36R,48L") // Numeric levelStyleOne = document.outline.levelStyle(0) levelStyleOne.clear() levelStyleOne.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleOne.set(Style.Attribute.FontFillColor, lvlOneFontColor) levelStyleOne.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleOne.set(Style.Attribute.FontSize, 19) levelStyleOne.set(Style.Attribute.FontWeight, 4) // Regular levelStyleOne.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleOne.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleOne.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleOne.set(Style.Attribute.ParagraphLineSpacing, null) levelStyleTwo = document.outline.levelStyle(1) levelStyleTwo.clear() levelStyleTwo.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleTwo.set(Style.Attribute.FontFillColor, lvlTwoFontColor) levelStyleTwo.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleTwo.set(Style.Attribute.FontSize, 18) levelStyleTwo.set(Style.Attribute.FontWeight, 4) // Regular levelStyleTwo.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleTwo.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleTwo.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleTwo.set(Style.Attribute.ParagraphLineSpacing, null) levelStyleThree = document.outline.levelStyle(2) levelStyleThree.clear() levelStyleThree.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleThree.set(Style.Attribute.FontFillColor, lvlThreeFontColor) levelStyleThree.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleThree.set(Style.Attribute.FontSize, 18) levelStyleThree.set(Style.Attribute.FontWeight, 4) // Regular levelStyleThree.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleThree.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleThree.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleThree.set(Style.Attribute.ParagraphLineSpacing, null) levelStyleFour = document.outline.levelStyle(2) levelStyleFour.clear() levelStyleFour.set(Style.Attribute.BackgroundColor, baseBckgndColor) levelStyleFour.set(Style.Attribute.FontFillColor, lvlFourFontColor) levelStyleFour.set(Style.Attribute.FontFamily, baseFontFamily) levelStyleFour.set(Style.Attribute.FontSize, 18) levelStyleFour.set(Style.Attribute.FontWeight, 4) // Regular levelStyleFour.set(Style.Attribute.ParagraphHeadIndent, 8) levelStyleFour.set(Style.Attribute.ParagraphFirstLineHeadIndent, 8) levelStyleFour.set(Style.Attribute.ParagraphLineHeightMultiple, 1.2) levelStyleFour.set(Style.Attribute.ParagraphLineSpacing, null) } catch(err){ console.error(err.name, err.message) } }); action.validate = function(selection, sender){ // validation code // selection options: columns, document, editor, items, nodes, outline, styles return true }; return action; })();