Here are the properties of the PlanDocument class: The PlanDocument class is a subclass of the Document class used to represent properties that are specific to OmniPlan documents.
Whether there are currently any actions that can be undone.Whether there are currently any actions that can be redone.ĬanUndo ( boolean r/o).Here are the properties of the Document class:ĬanRedo ( boolean r/o) (type => type.identifier) //-> (type => type.identifier) //-> Instance Properties Readable/Editable File Types for OmniPlan Copy Run Script TIP: When presenting a picker dialog to a script user, only enable the selection of the file types that the script is designed to process.
#Omniplan tutorial full#
You can get a full list of the names and identifiers of the file types for files that are either readable or editable by OmniPlan, by using the readableTypes and editableTypes properties of the TypeIdentifer class for OmniPlan. note the use of the project object in the reference chain to the rootTask of the new project.ġ5 Set the title of the newly created task. The resulting JavaScript promise object is stored in the variable: pickerPromiseĠ9-19 Use the then() method with the stored promise object to process the array of URLs chosen in the file picker.ġ0 Since multiple selections were not allowed, the resulting file URL will be the first in the array of one.ġ0-17 The OmniPlan openDocument(…) is called on the application object, passing in the chosen file URL to the then(…) callback function.ġ3-16 The callback function of the openDocument(…) command will pass-in a reference to the newly created document, and a boolean value indicating if it was already open.ġ4 Create a new task in the new project document. In this case, the bundle and single-file version of the standard OmniPlan document format.Ġ6 Set the file types for the file picker to the stored list of file types.Ġ7 Use the show() function to display the file picker. Var picker = new FilePicker() picker.folders = false picker.multiple = false var fileType1 = new FileType("") var fileType2 = new FileType("-zip") picker.types = var pickerPromise = picker.show() pickerPromise.then(urlsArray => )Ġ1 Create a new instance of the FilePicker class and store a reference to it in the variable: pickerĠ2-03 Set the properties of the file picker to select a single document file.Ġ4-05 Indicate the file types that can be selected within the file picker. On success, the second argument (wasOpen) is a Boolean value specifying whether the document was already open. The passed in function will return two arguments: the first (result) will be either either the Document reference or an Error.
The document, if any, that is associated with the calling script can be passed along to help grant permission to open the new document. Note that due to platform sandboxing restrictions, opening the document may fail if the application doesn’t have currently permission to access the given file URL. If the document is already open, the reference to the open document is passed along. This handler attempts to open the specified document and to return a reference to it asynchronously. To open an OmniPlan file, a file URL is passed to the openDocument() application method.
#Omniplan tutorial how to#
The following documentation describes how open, create, save, and close documents, as well as how to access a document’s properties. Unlike other classes of objects, such as graphics, that can be addressed by index, the “current document” is simply referenced as document instead of app. For security reasons, scripts can only address the frontmost document, they cannot query for or address other documents that may be open. A Document is the top-level object in Omni Automation.