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:
function makeFileWrapper(baseName:String, type:String or null) → (Promise r/o) • Generates a FileWrapper representing the contents of the document formatted as the specified type, or its current fileType if a null is passed for the type. Returns a Promise that will yield the file wrapper or an error. The returned file wrapper will have a name based off the given baseName and the default path extension for the requested file type.
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
The class functions for the FileWrapper class:
withContents(name:String or nil, contents:Data or nil) --> FileWrapper • Returns a new FileWrapper that represents a flat file containing the given data.
withChildren(name:String or null, children:Array of FileWrapper) --> FileWrapper • Returns a new FileWrapper that represents a directory with the given child file wrappers. Each child file wrapper must have a unique name specified.
The instance functions for the FileWrapper class:
filenameForChild(child:FileWrapper) --> String or nil • Returns the unique file name that will be used for the given child FileWrapper, or null if this file wrapper is not a child of the receiver.
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:
Directory --> (FileWrapper.Type r/o) • A FileWrapper that represents a directory with zero or more child wrappers.
File --> (FileWrapper.Type r/o) • A FileWrapper that represents a regular file with data contents.
Link --> (FileWrapper.Type r/o) • A FileWrapper that represents a symbolic link to another location.
As mentioned previously, here is a full explanation of the FileWrapper.Types supported by OmniPlan:
//-> FileWrapper Types as paragraphs
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.
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
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.
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.
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.