Document Export

OmniOutliner supports the export of outlines to documents of various formats, such as to standard office, spreadsheet, text, and HTML formats. In this section, we’ll examine how export documents using the built-in Omni Automaton commands.

FileWrappers

If you think of an outline as a set of data, then it’s easy to understand that an outline’s data can be packaged in a variety of ways. Each “data package” has a set of parameters that determine how the outline data is stored or presented.

For example, one package may store the data as tabbed data, while another may store the outline data in XML format. Each of the supported file packaging formats has its own set of parameters. In terms of Omni Automation, these file packages are referred to as FileWrappers.

Each FileWrapper has a unique type identifier that identifies that wrapper. To get a list of the export types supported by OmniOutliner, write a simple script to access the value of the writableTypes property of the Document class. The result will be an array of the identifiers for the FileWrappers supported in OmniOutliner:

A writable type is used when creating a new file wrapper instance:

wrapper = document.fileWrapper('com.omnigroup.OmniOutliner.CSVExport.CSV')

Instance Properties

Each FileWrapper instance has a set of supported properties, most of which have values that are read-only, with the exception of the preferredFilename property whose value can be set in a script.

wrapper = document.fileWrapper('com.omnigroup.OmniOutliner.CSVExport.CSV') wrapper.preferredFilename = "My Tabbed Export.csv"

The value of the contents property is a representation of the outline data, which can be manipulated using class and instance functions from the Data class:

wrapper = document.fileWrapper('com.omnigroup.OmniOutliner.CSVExport.CSV') wrapper.preferredFilename = "My Tabbed Export.csv" encodedData = wrapper.contents.toBase64()

Class Functions

The class functions for the FileWrapper class:

Instance Functions

The instance functions for the FileWrapper class:

FileWrapper.Type

The class properties of a FileWrapper.Type:

As mentioned previously, here is a full explanation of the FileWrapper.Types supported by OmniOutliner:

Here are the various export formats with their corresponding FileWrapper.Type:

CSV
When exporting a multi-column outline as CSV, OmniOutliner saves the .csv file using standard comma-separated values (CSV) conventions (i.e., each column is separated by a comma, and text with spaces is placed within quotations).
com.omnigroup.OmniOutliner.CSVExport.CSV
Excel 2010 Format
Creates a .xlsx spreadsheet document capable of being read in Microsoft Excel 2010 (and other versions of Excel that support the format). This export option maps most closely to multi-column data outside OmniOutliner, and does its best to replicate styles between the two (within the limits of Excel).
com.microsoft.excel.openxml.document
HTML
Creates a like-named folder that contains an index.html file along with the necessary images and attachments that make up your OmniOutliner file. All of the styles you’ve used in OmniOutliner are converted to CSS and included in the index.html file.
com.omnigroup.OmniOutliner.SimpleHTMLExport.HTML
HTML (Dynamic)
This option gives you everything that comes with the basic HTML export, plus an added outliner.js file. This JavaScript file is what makes the file dynamic; you can open and close the sections of your document just as you would in OmniOutliner.
com.omnigroup.OmniOutliner.HTMLExport.HTMLDynamic
com.omnigroup.OmniOutliner.OO3HTMLExport.OO3HTMLDynamic
Microsoft Word (indented)
Creates a .docx file that opens in the default page layout view and retains the outline structure via indentation. This export option only includes the topic column, and is primarily useful for transitioning from an outline to a word processor (rather than duplicating OmniOutliner’s functionality in Word). Row level styles are converted to heading styles, and other styles are flattened and applied directly to text (Microsoft Word does not support OmniOutliner’s style model).
com.omnigroup.word.openxml.indented
Microsoft Word (outline)
Creates a .docx file that opens by default in Microsoft Word’s Outline view. Choose this option to export an outline that can be readily expanded upon in Word. This export option only includes the topic column.
com.omnigroup.word.openxml.outline
OmniOutliner Document
Exports a .ooutline file, the current default OmniOutliner file format (for OmniOutliner 5 and later).
com.omnigroup.omnioutliner.ooutline
com.omnigroup.omnioutliner.xmlooutline
com.omnigroup.omnioutliner.xmlooutline-package
OmniOutliner Template
Exports a .otemplate file which can be used as the base theme for other OmniOutliner outlines. This template format is not compatible with versions earlier than OmniOutliner 5.
com.omnigroup.omnioutliner.otemplate
com.omnigroup.omnioutliner.otemplate-package
OmniOutliner 3
Exports a .oo3 file which can be opened in either OmniOutliner 3 or 4 for Mac, and in OmniOutliner 1 for iPad and OmniOutliner 2 for iOS. These files are not compatible with OmniOutliner 2 for Mac and earlier. They can be opened in OmniOutliner 5, but must be updated to the newer .ooutline format before all editing features are available.
com.omnigroup.omnioutliner.oo3
com.omnigroup.omnioutliner.oo3-package
OmniOutliner 3 Template
Exports a .oo3template file which can be opened in either OmniOutliner 3 or 4. These files are not compatible with OmniOutliner 2 or earlier. They can be opened in OmniOutliner 5, but must be updated to the newer .otemplate format before they can be edited.
com.omnigroup.omnioutliner.oo3template
com.omnigroup.omnioutliner.oo3template-package
OPML (Outline Processor Markup Language)
Exports a .opml file, which retains the hierarchical structure of your outline. However, OPML files do not retain any of the styles or attachments you may have applied in OmniOutliner.
org.opml.opml
com.apple.news.opml
org.opml.opmltemplate
Plain Text (with tabs)
Exports a raw .txt file without any styles. Child rows and columns are aligned using tabs rather than spaces, making this type of export useful for importing into spreadsheet apps such as Numbers or Excel.
PowerPoint 2012 Format (pptx)
OmniOutliner exports the contents of your outline in an XML format that PowerPoint 2012 can interpret and render. After exporting your outline as .pptx, you can then import the PowerPoint file into Apple’s Keynote app.
Each Level 1 row becomes a separate slide in the PowerPoint presentation, with its children listed on that slide, and notes become presenter notes. Very little styling is carried over from OmniOutliner (styles don’t match well between the two formats, so we err on the side of removing them).
Image attachments are placed on slides corresponding to their level in the hierarchy, but must be manually repositioned to the desired location on the slide.
org.openxmlformats.presentationml.presentation.PowerPoint 2012 Format (pptx)
RTF (Rich Text Format)
Exports a .rtf file, which retains all of the styles you’ve applied in OmniOutliner. RTF is a standard document format that most word processors, such as Word and macOS’s TextEdit app can open. Export to RTF if your Outliner document contains only text and numbers.
public.rtf
RTFD (Rich Text Format with Attachments)
Exports a .rtfd file, which retains all of the styles you’ve applied in OmniOutliner. What sets RTFD apart from RTF is that an RTFD file can contain attachments, such as any images, audio clips, or anything else you attach to your OmniOutliner file. Most word processors, such as Word, Pages, and macOS’s TextEdit can open .rtfd files.
com.apple.rtfd

Export Examples

Here are some examples of using FileWrappers to export OmniOutliner documents.

Here’s an Omni Automation script for creating a new task in OmniFocus with the current OmniOutliner document as an attachment. The script uses the integrated URL support in OmniFocus to create and run a URL link for creating tasks:

wrapper = document.fileWrapper() taskName = encodeURIComponent(document.name) attachmentName = encodeURIComponent(wrapper.preferredFilename) encodedData = wrapper.contents.toBase64() urlStr = "omnifocus://localhost/add?name=" + taskName + "&attachment=" + encodedData + "&attachment-name=" + attachmentName URL.fromString(urlStr).call(function(result){})
omnioutliner://localhost/omnijs-run?script=wrapper%20%3D%20document%2EfileWrapper%28%29%0AtaskName%20%3D%20encodeURIComponent%28document%2Ename%29%0AattachmentName%20%3D%20encodeURIComponent%28wrapper%2EpreferredFilename%29%0AencodedData%20%3D%20wrapper%2Econtents%2EtoBase64%28%29%0AurlStr%20%3D%20%22omnifocus%3A%2F%2Flocalhost%2Fadd%3Fname%3D%22%20%2B%20taskName%20%2B%20%22%26attachment%3D%22%20%2B%20encodedData%20%2B%20%22%26attachment-name%3D%22%20%2B%20attachmentName%0AURL%2EfromString%28urlStr%29%2Ecall%28function%28result%29%7B%7D%29

 1  Create an instance of a FileWrapper for the document. Since no parameter is included within the parens, the default export settings are used.

 2  Encode the document name to be used as the name of the task.

 3  Encode the document file name to be used as the attachment name.

 4  Encode the contents of the document in Base 64 encoding format, which results in a string of URL approved characters.

 5  Combine the encoded elements into the URL format supported by OmniFocus.

 6  Convert the URL string into a URL object and execute it using the call() method.

More information about implementing the previous script as an Omni Automation action can be found here.

The following example script utilize the built-in eMail support in OmniOutliner to add export copies of the current document to new outgoing mail messages:

var wrapper = document.fileWrapper('public.plain-text') var email = new Email() email.subject = "Plain-Text Version of “" + document.name + "”" email.body = "Here is the plain-text version of the document for you!\n\n" email.fileWrappers = [wrapper] email.generate()
omnioutliner:///omnijs-run?script=var%20wrapper%20%3D%20document%2EfileWrapper%28%27public%2Eplain-text%27%29%0Avar%20email%20%3D%20new%20Email%28%29%0Aemail%2Esubject%20%3D%20%22Plain-Text%20Version%20of%20%E2%80%9C%22%20%2B%20document%2Ename%20%2B%20%22%E2%80%9D%22%0Aemail%2Ebody%20%3D%20%22Here%20is%20the%20plain-text%20version%20of%20the%20document%20for%20you%21%5Cn%5Cn%22%0Aemail%2EfileWrappers%20%3D%20%5Bwrapper%5D%0Aemail%2Egenerate%28%29
var wrapper = document.fileWrapper('org.openxmlformats.presentationml.presentation.PowerPoint 2012 Format (pptx)') var email = new Email() email.subject = "Presentation of “" + document.name + "”" email.body = "Here is the presentation version of the document for you!\n\n" email.fileWrappers = [wrapper] email.generate()
omnioutliner:///omnijs-run?script=var%20wrapper%20%3D%20document%2EfileWrapper%28%27org%2Eopenxmlformats%2Epresentationml%2Epresentation%2EPowerPoint%202012%20Format%20%28pptx%29%27%29%0Avar%20email%20%3D%20new%20Email%28%29%0Aemail%2Esubject%20%3D%20%22Presentation%20of%20%E2%80%9C%22%20%2B%20document%2Ename%20%2B%20%22%E2%80%9D%22%0Aemail%2Ebody%20%3D%20%22Here%20is%20the%20presentation%20version%20of%20the%20document%20for%20you%21%5Cn%5Cn%22%0Aemail%2EfileWrappers%20%3D%20%5Bwrapper%5D%0Aemail%2Egenerate%28%29
var wrappers = [] document.writableTypes.forEach(function(type){ var wrapper = document.fileWrapper(type) wrappers.unshift(wrapper) }); var email = new Email() email.subject = "Exports of “" + document.name + "”" email.body = "Here are the exported document versions for you!\n\n" email.fileWrappers = wrappers email.generate()
omnioutliner:///omnijs-run?script=var%20wrappers%20%3D%20%5B%5D%3B%0Adocument%2EwritableTypes%2EforEach%28function%28type%29%7B%0A%09var%20wrapper%20%3D%20document%2EfileWrapper%28type%29%3B%0A%09wrappers%2Eunshift%28wrapper%29%3B%0A%7D%29%3B%0A%0Avar%20email%20%3D%20new%20Email%28%29%3B%0Aemail%2Esubject%20%3D%20%22Exports%20of%20%E2%80%9C%22%20%2B%20document%2Ename%20%2B%20%22%E2%80%9D%22%3B%0Aemail%2Ebody%20%3D%20%22Here%20are%20the%20exported%20document%20versions%20for%20you%21%5Cn%5Cn%22%3B%0Aemail%2EfileWrappers%20%3D%20wrappers%3B%0Aemail%2Egenerate%28%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