Document Export

OmniPlan supports the export of documents to files of various formats. This section examines how to create File Wrappers in preparation for the export of documents and content.

Documentation regarding the other classes involved in the saving and export of OmniPlan documents can be found in FileTypes and FileSavers.


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 OmniPlan:


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

wrapper = document.fileWrapper('com.Adobe.pdf')

IMMPORTANT: the previously used fileWrapper(…) function has been deprecated in favor of the makeFileWrapper(…) function, which returns a JavaScript Promise object as its result:

wrapperPromise = document.makeFileWrapper('My File Name', 'public.comma-separated-values-text') wrapperPromise.then(function(wrapper){ console.log(wrapper) })

NOTE: If the document identifier parameter is omitted from the makeFileWrapper(…) function, the default document type (OmniPlan Document (.oplx)) is automatically used.

wrapperPromise = document.makeFileWrapper('My File Name') wrapperPromise.then(function(wrapper){ console.log(wrapper) })

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.

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.

For example, here’s an example of exporting the current canvas to a new OmniFocus task as a PNG image:

var docName = wrapperPromise = document.makeFileWrapper(docName, 'public.png') wrapperPromise.then(function(wrapper){ encodedData = wrapper.contents.toBase64() taskName = encodeURIComponent(docName) attachmentName = taskName + ".png" urlStr = "omnifocus://localhost/add?name=" + taskName + "&attachment=" + encodedData + "&attachment-name=" + attachmentName URL.fromString(urlStr).call(function(result){console.log(result)}) })

 01  Store the name of the OmniPlan document.

 02  Call the makeFileWrapper(…) function on the Document class, passing in the stored document name nas the name for the created file, and "public.png" as the file type identifier. The resulting JavaScript Promise object is stored in the variable: wrapperPromise

 03-09  The promise object is resolved by calling the then(…) function on the stored instance. By default, the call-back function will be provided the created file wrapper instance as its default passed parameter.

 04  The value provided by the wrapper’s contents property is converted into a base-64 encoded string using the toBase64() function of the Data class.

 05  The document name is URL encoded to be used as the title of the created OmniFocus task.

 06  The image attachment file name is the same as the task name with the ".png" file extension appended to it.

 07  The OmniFocus URL string is generated by inserted the stored data after the named parameters.

 08  The OmniFocus URL string is converted into a URL object, and the new url is executed using the call() method. The result of the task creation will be a URL link to the created task, similar to: omnifocus:///task/p6zgTDGjLt0

Class Functions

The class functions for the FileWrapper class:

Instance Functions

The instance functions for the FileWrapper class:

The following example uses the FileWrapper.withChildren(…) function to generate a new folder containing mutliple image export files. Note the use of the Promise.all() function to handle mutliple instances of file wrapper promises:

docName = PNGwrapperPromise = document.makeFileWrapper(docName, "public.png") PDFwrapperPromise = document.makeFileWrapper(docName, "public.jpeg") promises = [PNGwrapperPromise,PDFwrapperPromise] Promise.all(promises).then(function(fileWrappers){ filesaver = new FileSaver() folderType = new FileType("public.folder") filesaver.types = [folderType, FileType.png, FileType.jpeg] fldrwrapper = FileWrapper.withChildren("Export Folder",fileWrappers) fileSaverPromise = fileSaverPromise.then(function(urlObj){ console.log(urlObj.string) // file url to directory }) fileSaverPromise.catch(function(err){ console.log(err.message) }) }).catch(function(err){ console.log("Error", err.message) })


The class properties of a FileWrapper.Type:

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

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

OmniPlan Document (.oplx)
Of course, OmniPlan can export to its own format. This is useful when you want to use the filtering feature to make a new OmniPlan file of tasks matching certain criteria—just filter the tasks and make sure that Only Filtered Contents is checked when you go to export the project.
iCalendar (.ics)
This is the calendar format used by Apple iCal, Apple Calendar, and many other calendar applications. You can choose to export the tasks as calendar events or as items on a to-do list. If you export calendar events, you can also choose whether each task should become to a single event, regardless of how long it may be (One event per task), or whether tasks should be broken into chunks when they span working and non-working hours (One event per work period).
Comma Separated Values (.csv)
CSV is a common, plain-text format that can be read by many different applications. If you’re having trouble persuading other applications to read the non-ASCII characters in your CSV file, such as accented letters or non-Roman characters, try exporting with one of the other encoding options. This makes it easier for some applications to detect the correct encoding and interpret your characters properly.
Image Export (.png, .pdf, .tiff, .jpg)
You can export a picture of the task view or the resource view, whichever one is open in the main window. In the Export panel, you can choose whether the image should include the outline, the chart, or both.
public.png, public.tiff, public.jpeg
OmniOutliner (.oo3)
The task outline is exported as an OmniOutliner file (supported by OmniOutliner 3 and 4), with row hierarchy that corresponds to OmniPlan’s task groupings and columns corresponding to those available in OmniPlan’s Task View.
There are several types of OmniGraffle export available across an array of diagram types and style. Available diagram types for export include:
Work Breakdown Structure—Tasks and groups are represented by a tree of objects. The connection lines in this diagram type represent the hierarchy of the task outline; dependency lines are not represented.
Activity-on-Node Network Diagram—Tasks are represented by objects, connected by dependency lines. While a Gantt chart emphasizes durations, this type of chart emphasizes the path of dependencies.
Activity-on-Arrow Network Diagram—Tasks are represented as lines between objects, with the title and duration of the task as a label on each line. Like the Activity-on-Node network diagram, this diagram type emphasizes dependencies.
When exporting to a Work Breakdown Structure or an Activity-on-Node network diagram, you can choose between two different node Styles: nodes that represent tasks as basic objects (which just show the task name) or as tables (which show the task name, assigned resources, start date and end date).
Microsoft Project Support (Pro)
Exports a .ooutline file, containing the textual data from the OmniGraffle canvas. Exporting to OmniOutliner works best for diagrams that adhere to a tree-like structure. OmniGraffle uses the connection lines between shapes to create the outline hierarchy.,
If you’re ever called upon to reach across the aisle and use OmniPlan in tandem with Microsoft Project, there’s good news—OmniPlan Pro supports both export to and import from the vast majority of Project file formats.
Documents in the Microsoft Project XML or MPP formats created with Microsoft Project versions 2003 through 2016 can be opened by OmniPlan Pro.
Along with importing from the most-used MS Project formats, OmniPlan Pro can output to them as well. The following Microsoft Project formats are supported:
Extensible Markup Language (XML) and Microsoft Project Plan (MPP) Microsoft Project 2003 to 2016 can read and write these formats. MPP is the preferred format for most interactions with modern versions of Microsoft Project; as an open standard, XML is useful for interaction with other applications as well.
NOTE: OmniPlan’s Microsoft Project MPP export is updated to be most highly compatible with the newest MPP format we support (that used by Microsoft Project 2016). MPP files generated by OmniPlan will still open in older versions of Microsoft Project, but may not be as fully readable to them. Older versions of Microsoft Project may prompt you to download an update or converter from Microsoft to support the newer file format exported by OmniPlan.
See the built-in OmniPlan Help documentation for details concerning Microsoft Project exports.
docName = wrapperPromise = document.makeFileWrapper(docName, '') wrapperPromise.then(function(wrapper){ filesaver = new FileSaver() filetype = new FileType('') filesaver.types = [filetype] fileSaverPromise = fileSaverPromise.then(function(urlObj){ console.log(urlObj.string) // url to saved file }) fileSaverPromise.catch(function(err){ console.log(err.message) }) }).catch(function(error){ console.error(error.message) })

 01  Store the name of the OmniPlan project file.

 02  A file wrapper is created using the makeFileWrapper(…) function, which is passed the Microsft Project file type identifier and the OmniPlan Project name as parameters. The function returns an instance of the JavaScript Promise class, which when resolved will provide the created file wrapper instance. The generated promise is stored in the variable: wrapperPromise

 04-17  The stored promise is resolved by calling the then(…) function on the stored instance. If the wrapper creation is successful, the method’s call-back function will be passed a reference to the created file wrapper.

 05  With the file wrapper created, the script can now display the file saver dialog to the user so they may provide the file name and saving location. A new instance of the FileSaver class is created and stored in the variable: filesaver

 06  Create and store an instance of the FileType class using the Microsoft Project file type identifier.

 07  The value of the types property of the FileSaver class is an array of file types to be exported. In this example the property value will be an array containing a single file type instance.

 08  The saving dialog is displayed by calling the show(…) function and passing in the stored file wrapper instance as the parameter. The result of the function call is a JavaScript Promise instance, which is stored in the variable: fileSaverPromise

 10-12  When the user completes the saver dialog, the stored fileSaverPromise will be resolved by calling the then(…) function will automatically be passed a URL object referencing the saved file. The passed url can be used to perform any follow-up processing with the created file.

 14-16  Should the user cancel the saving dialog or should a problem occur during the processing of writing the file, the defining error will be passed into the catch(…) function, allowing the script to deal with the issue.

 17-19  The catch(…) function call is appended to the wrapper promise resolution call, so that any problem in creating the file wrapper can be dealt with by the script.


This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.