Omniplan Windows, Corel Painter 2016 Review, Vmware Workstation 12 Installer, Cheap Adobe Premiere Pro CS6.
- With OmniPlan, you can create logical, manageable project plans with Gantt charts, schedules, summaries, milestones, and critical paths. Break down the tasks needed to make your project a success, optimize resources, and streamline budgets. It's project management made painless.
- OmniPlan for Mac list of features include the following: Collaboration, Document Management, Issue Tracking, Project Management, Resource Management,. Target customer size. Microsoft Project is best for all sizes of business as well as individual users. The software is a useful product for businesses of all sizes and a variety of types.
- Omniplan Windows, Corel Painter 2016 Review, Vmware Workstation 12 Installer, Cheap Adobe Premiere Pro CS6.
- Alternatives to OmniPlan. Compare OmniPlan alternatives for your business or organization using the curated list below. SourceForge ranks the best alternatives to OmniPlan in 2020. Compare features, ratings, user reviews, pricing, and more from OmniPlan competitors and alternatives in order to make an informed decision for your business.
OmniPlan: Document
A Document is the top-level object in Omni Automation. For security reasons, scripts can only address the frontmost document, they cannot query for or address other documents that may be open. 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.documents[0] in your scripts.
The following documentation describes how open, create, save, and close documents, as well as how to access a document’s properties.
Open Document
To open an OmniPlan file, a file URL is passed to the openDocument application method. This handler attempts to open the specified document and to return a reference to it asynchronously. If the document is already open, the reference to the open document is passed along.
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. The document, if any, that is associated with the calling script can be passed along to help grant permission to open the new document.
The passed in function will return two arguments: the first (result) will be either either the Document reference or an Error. On success, the second argument (wasOpen) is a Boolean value specifying whether the document was already open.
app.openDocument(document,fileURL,function(result,wasOpen){}
Open Document | ||
01 | app.openDocument(document,fileURL,function(result,wasOpen){} |
A an example, here is a script that uses the FilePicker class to prompt the user to locate and select an OmniPlan document (in either file or package format) and then open the chosen document:
var picker = new FilePicker()picker.folders = falsepicker.multiple = falseaFileType = new FileType('com.omnigroup.omniplan2.planfile','com.omnigroup.omniplan2.planfile-zip')picker.types = [aFileType]pickerPromise = picker.show()pickerPromise.then(function(urlsArray){ fileURL = urlsArray[0] app.openDocument( document, fileURL, function(doc,wasOpen){ task = doc.project.actual.rootTask.addSubtask() task.title = 'NEW TASK' } )})
omniplan://localhost/omnijs-run?script=try%7Bvar%20picker%20%3D%20new%20FilePicker%28%29%0Apicker%2Efolders%20%3D%20false%0Apicker%2Emultiple%20%3D%20false%0AaFileType%20%3D%20new%20FileType%28%22com%2Eomnigroup%2Eomniplan2%2Eplanfile%22%2C%22com%2Eomnigroup%2Eomniplan2%2Eplanfile%2Dzip%22%29%0Apicker%2Etypes%20%3D%20%5BaFileType%5D%0ApickerPromise%20%3D%20picker%2Eshow%28%29%0A%0ApickerPromise%2Ethen%28function%28urlsArray%29%7B%0A%09fileURL%20%3D%20urlsArray%5B0%5D%0A%09app%2EopenDocument%28%0A%09%09document%2C%0A%09%09fileURL%2C%0A%09%09function%28doc%2CwasOpen%29%7B%0A%09%09%09task%20%3D%20doc%2Eproject%2Eactual%2ErootTask%2EaddSubtask%28%29%0A%09%09%09task%2Etitle%20%3D%20%22NEW%20TASK%22%0A%09%09%7D%0A%09%29%0A%7D%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D
Choose and Open Document | ||
01 | varpicker = newFilePicker() | |
02 | picker.folders = false | |
03 | picker.multiple = false | |
04 | aFileType = newFileType('com.omnigroup.omniplan2.planfile','com.omnigroup.omniplan2.planfile-zip') | |
05 | picker.types = [aFileType] | |
06 | pickerPromise = picker.show() | |
07 | ||
08 | pickerPromise.then(function(urlsArray){ | |
09 | fileURL = urlsArray[0] | |
10 | app.openDocument( | |
11 | document, | |
12 | fileURL, | |
13 | function(doc,wasOpen){ | |
14 | task = doc.project.actual.rootTask.addSubtask() | |
15 | task.title = 'NEW TASK' | |
16 | } | |
17 | ) | |
18 | }) |
01 Create a new instance of the FilePicker class and store a reference to it in the variable: picker
02-03 Set the properties of the file picker to select a single document file.
04 Indicate the file types that can be selected within the file picker. In this case, the bundle and single-file version of the standard OmniPlan document format.
05 Set the file types for the file picker to the stored list of file types.
06 Use the show() function to display the file picker. The resulting JavaScript promise object is stored in the variable: pickerPromise
08-18 Use the then() method with the stored promise object to process the array of URLs chosen in the file picker.
09 Since multiple selections were not allowed, the resulting file URL will be the first in the array of one.
10-17 The OmniPlan openDocument(…) is called on the application object, passing in the chosen file URL to the then(…) callback function.
13-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.
14 Create a new task in the new project document. note the use of the project object in the reference chain to the rootTask of the new project.
15 Set the title of the newly created task.
Instance Properties
Here are the properties of the Document class: Opera 63 0 3368 66.
- canRedo (booleanr/o) • Whether there are currently any actions that can be redone.
- canUndo (booleanr/o) • Whether there are currently any actions that can be undone.
- name (Stringr/o) • Name of the document.
- writableTypes (Array of Stringsr/o) • A list of the identifiers for all of the possible document types for writing the document to file.
- fileType (Stringr/o) • The file type identifier the document uses when saving, if set.
Instance Properties: PlanDocument
The PlanDocument class is a subclass of the Document class used to represent properties that are specific to OmniPlan documents. Here are the properties of the PlanDocument class:
- project (Projectr/o) • The value of this property is a reference to the OmniPlan project object contained by the document.
- windows (Array of NSWindowsr/o) • An array of references to the windows that display the OmniPlan document content.
Class Functions
Here are the functions for the Document class of objects:
- makeNew(resultFunction:Function) (PlanDocument) • Create a new document, which can be populated with data and then presented. On iOS, if the document is not presented by the time the resultFunction returns, it will be closed. On macOS, the document will be left around and accessible to the running script. The resultFunction will be passed either the new document or an Error if there was a problem creating the document.
- makeNewAndShow(resultFunction:Function) (PlanDocument) • Create a new document and presents it. The resultFunction will be passed either the new document or an Error if there was a problem creating the document.
Instance Functions
Here are the functions for an instance of the Document class:
- close(didCancel:Function or null) • Close this document. If for some reason the document cannot be closed, the didCancel function may be called at some point in the future, with the original document as the single argument. For example, on the Mac the user may review unsaved changes and may cancel the close operation. If the document is closed, the didCancel function will not be called at all.
- save() • Save the document into its source file, if the document has been saved before. If the document has not been already saved once, summon the Save sheet.
- fileWrapper(type:String or null) → (FileWrapper) • Returns a new FileWrapper representing the contents of the document formatted as the specified type, or its current fileType if a null is passed for the type.
- undo() • Undo the last done action.
- redo() • Redo the last undone action.
- show(resultFunction:Function or null) • Presents the document, ordering the window forward on macOS, and possibly closing the existing document and opening the new on on iOS.
Examples
Name
The read-only name property has a value that is the name of the OmniPlan document as it appears in the title bar of the document window. On macOS, this value will reflect the value of the Finder’s file extension visibility setting, set in the file’s Information window.
01 | document.name |
02 | --> 'Construction Project' |
Writable Types
The value of the writableTypes property of the document class is an array (list) of all of the file types that this document can be written as.
- com.omnigroup.omniplan2.planfile-zip
- com.omnigroup.omniplan2.planfile
- com.apple.ical.ics
- public.comma-separated-values-text
- com.microsoft.mpp
- com.microsoft.project.mspdi
- public.png
- com.adobe.pdf
- public.tiff
- public.jpeg
- com.omnigroup.omnioutliner.oo3
- com.omnigroup.omnigraffle.graffle
File Type
The value of the fieType property of the document class is the default file type that this document is set to be saved as.
File Type | ||
01 | document.fileType | |
02 | //-->'com.omnigroup.omniplan2.planfile' |
Document Undo
If the value of the document’s canUndo property is true, then the undo() method can be used to undo the previous user or script action.
omnigraffle:///omnijs-run?script=if%28document%2EcanUndo%29%7Bdocument%2Eundo%28%29%7D
Document Undo | ||
01 | if(document.canUndo){document.undo()} |
Document Redo
If the value of the document’s canRedo property is true, then the redo() method can be used to re-apply the previous user or script action.
omnigraffle:///omnijs-run?script=if%28document%2EcanRedo%29%7Bdocument%2Eredo%28%29%7D
Document Redo | ||
01 | if(document.canRedo){document.redo()} |
New Document
The makeNew(…) and makeNewAndShow(…) instance functions of the Document class are used to create and display a new OmniPlan document.
- makeNew(resultFunction:Function) (PlanDocument) • Create a new document, which can be populated with data and then presented. On iOS, if the document is not presented by the time the resultFunction returns, it will be closed. On macOS, the document will be left around and accessible to the running script. The resultFunction will be passed either the new document or an Error if there was a problem creating the document.
- makeNewAndShow(resultFunction:Function) (PlanDocument) • Create a new document and presents it. The resultFunction will be passed either the new document or an Error if there was a problem creating the document.
cDoc = documentconsole.log(cDoc.name)Document.makeNew((nDoc)=>{ console.log(nDoc.name) task = nDoc.project.actual.rootTask.addSubtask() task.title = 'NEW RESOURCE'})
omniplan://localhost/omnijs-run?script=try%7BcDoc%20%3D%20document%0Aconsole%2Elog%28cDoc%2Ename%29%0ADocument%2EmakeNew%28%28nDoc%29%3D%3E%7B%0A%09console%2Elog%28nDoc%2Ename%29%0A%09task%20%3D%20nDoc%2Eproject%2Eactual%2ErootTask%2EaddSubtask%28%29%0A%09task%2Etitle%20%3D%20%22NEW%20RESOURCE%22%0A%7D%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D
Create New Document (makeNew) | ||
01 | cDoc = document | |
02 | console.log(cDoc.name) | |
03 | Document.makeNew((nDoc)=>{ | |
04 | console.log(nDoc.name) | |
05 | task = nDoc.project.actual.rootTask.addSubtask() | |
06 | task.title = 'NEW RESOURCE' | |
07 | }) |
01 (optional) Store a reference to the current document in the variable: cDoc
02 (optional) Log the name of the current document in the Automation Console.
03 Call the makeNew(…) function on the Document class to generate a new instance (document). The passed-parameter of the function is a callback function that is passed either an error or a reference to the newly created document in the parameter variable: nDoc
04 (optional) Log the name of the newly created document in the Automation Console.
05 Create a new top-level task in the new document. Note that a reference chain to the actual scenario, including the specified project property of the PlanDocument class, is used when calling the newSubtask(…) function. This is done to avoid inadvertently referencing the previous document. The resulting reference to the created task is stored in the variable: task
06 Set the value of the title property of the new task object.
And a version of the previous script that uses the makeNewAndShow(…) function to create, display, and triggers a saving sheet for a new document that contains a new task.
Document.makeNewAndShow((nDoc)=>{ task = nDoc.project.actual.rootTask.addSubtask() task.title = 'NEW TASK' nDoc.save()})
omniplan://localhost/omnijs-run?script=try%7BDocument%2EmakeNewAndShow%28%28nDoc%29%3D%3E%7B%0A%09task%20%3D%20nDoc%2Eproject%2Eactual%2ErootTask%2EaddSubtask%28%29%0A%09task%2Etitle%20%3D%20%22NEW%20TASK%22%0A%09nDoc%2Esave%28%29%0A%7D%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D
Create & Save New Document (makeNewAndShow) | ||
03 | Document.makeNewAndShow((nDoc)=>{ | |
05 | task = nDoc.project.actual.rootTask.addSubtask() | |
06 | task.title = 'NEW TASK' | |
06 | nDoc.save() | |
07 | }) |
Document Close
Close the current host document.
omniplan://localhost/omnijs-run?script=document%2Eclose%28%29
Document Close | ||
01 | document.close() |
Create a new document and close the previous docuemnt.
var oldDoc = documentDocument.makeNewAndShow(function(newDoc){ oldDoc.close()})
omniplan://localhost/omnijs-run?script=var%20oldDoc%20%3D%20document%0ADocument%2EmakeNewAndShow%28function%28newDoc%29%7B%0A%09oldDoc%2Eclose%28%29%0A%7D%29
New Document Closing Current Document | ||
01 | varoldDoc = document | |
02 | Document.makeNewAndShow(function(newDoc){ | |
03 | oldDoc.close() | |
04 | }) |
Create a new document, edit the new document, and then close the previous docuemnt.
IMPORTANT: Do not attempt to close the original document until the end of the script. Scripts are run within the context of a document. The script creating a new document is run in context of the document running the script. Closing the document owning the script will halt the script’s execution.
var oldDoc = documentDocument.makeNewAndShow(function(newDoc){ task = newDoc.project.actual.rootTask.addSubtask() task.title = 'NEW TASK' oldDoc.close()})
omniplan://localhost/omnijs-run?script=try%7Bvar%20oldDoc%20%3D%20document%0ADocument%2EmakeNewAndShow%28function%28newDoc%29%7B%0A%09task%20%3D%20newDoc%2Eproject%2Eactual%2ErootTask%2EaddSubtask%28%29%0A%09task%2Etitle%20%3D%20%22NEW%20TASK%22%0A%09oldDoc%2Eclose%28%29%0A%7D%29%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D
New Document, Add Task, Close Previous Document | ||
01 | varoldDoc = document | |
02 | Document.makeNewAndShow(function(newDoc){ | |
03 | task = newDoc.project.actual.rootTask.addSubtask() | |
04 | task.title = 'NEW TASK' | |
05 | oldDoc.close() | |
06 | }) |
The “Big Picture” Silver screen 1 0 1.
Most scriptable applications are designed with a hierarchical organization where the scriptable elements are contained within other elements. For example, the OmniPlan application edits documents that contain projects that contain scenarios that contain tasks and resources.
In the OmniPlan scripting implementation:
- A Project represents the main contents of an OmniPlan Document and is used as the global object in any scripting session that is related to a particular document.
- A Scenario represents a set of tasks and resources and associated schedules. The actuals for a project are one scenario, and saved baselines are the others.
The illustration below shows the hierarchical nature and relationships of the scriptable OmniPlan objects (both on macOS and iOS).
Application Ishowu instant advanced 1 3 18.
In Omni Automation scripts, the application object is represented by the abbreviation: “app”. The application object is addressed by scripts to determine the current system platform, pressed modifier keys, and for opening documents. (see Application section)
01 | app.name |
02 | --> OmniPlan |
Documents