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.
![omniplan examples omniplan examples](https://discourse.omnigroup.com/uploads/default/optimized/2X/7/7acd898d9bf30a89ddade5f9c6f739ae2f9dcf33_2_1035x540.png)
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 EXAMPLES 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.
![omniplan examples omniplan examples](https://appedus.com/wp-content/uploads/2021/07/OmniPlan-App-Review-Appedus.png)
For security reasons, scripts can only address the frontmost document, they cannot query for or address other documents that may be open.
![omniplan examples omniplan examples](https://db-excel.com/wp-content/uploads/2018/10/omniplan-3-for-mac-user-manual-getting-to-know-omniplan-within-gantt-chart-template-mac-1784x970.png)
A Document is the top-level object in Omni Automation.