×

Omni Automation Tutorial for OmniFocus

Welcome to the introductory tutorial for learning about Omni Automation in the OmniFocus application from The Omni Group.

This step-by-step guide will introduce you to the power and abilities of the device-independent JavaScript scripting implementation in OmniFocus (called Omni Automation) and in a short time, get you on the path to creating your own automation tools.

You’ll find that a general knowledge of the basics of the JavaScript language will be useful to acquire prior to exploring this tutorial, as the following lessons assume you have experience with fundamental concepts, objects, functions, and methods of the JavaScript language.

Fortunately, JavaScript is one of the most widely documented technologies there is and you’ll find no shortage of excellent instructional materials. For example, here are a few of the many online resources available for you:

Once you’ve gained some understanding of the basics of the JavaScript language, you’re ready to proceed with this tutorial.

To navigate to the various pages of this section, use the Navigation Overlay that can be summoned via the navigation overlay menu ( <- top left of this page). Additionally, the Navigation Overlay may be summoned/dismissed using these keyboard shortcuts: Control-Option-N (⌃⌥N) and Control-Option-C (⌃⌥C)

One more thing…

This tutorial uses special script links to interact directly with your copy of OmniFocus. Visit the “Script Security” page to learn how to enable the execution of remote scripts (like those from this website) in an Omni application. Once enabled, you’re ready to proceed with learning how to automate OmniFocus!

 

var matchedProjects = flattenedProjects.filter(project => {return project.name === "OmniFocus Tutorial"}) console.log(matchedProjects) if(matchedProjects.length === 0){ var project = new Project("OmniFocus Tutorial") project.task.sequential = true project.completedByChildren = true var tutorialTopics = [{"title":"Introduction","page":"index.html"},{"title":"Console","page":"console.html"},{"title":"Inbox","page":"inbox.html"},{"title":"Due and Repeat","page":"task.html"},{"title":"Tags","page":"tag.html"},{"title":"Projects","page":"project.html"},{"title":"Plug-Ins","page":"plug-in.html"},{"title":"Cleanup and Restore","page":"cleanup.html"}] var baseURL = "https://omni-automation.com/omnifocus/tutorial/" tutorialTopics.forEach(topicObj => { var tsk = new Task(topicObj.title,project) tsk.note = baseURL + topicObj.page }) var projectID = project.task.id.primaryKey URL.fromString("omnifocus:///task/" + projectID).open() } else { var projectID = matchedProjects[0].task.id.primaryKey URL.fromString("omnifocus:///task/" + projectID).open() var alertMsg = "A project named “OmniFocus Tutorial” already exists." new Alert("Existing Project",alertMsg).show() }
omnifocus://localhost/omnijs-run?script=try%7Bvar%20matchedProjects%20%3D%20flattenedProjects%2Efilter%28project%20%3D%3E%20%7Breturn%20project%2Ename%20%3D%3D%3D%20%22OmniFocus%20Tutorial%22%7D%29%0Aconsole%2Elog%28matchedProjects%29%0Aif%28matchedProjects%2Elength%20%3D%3D%3D%200%29%7B%0A%09var%20project%20%3D%20new%20Project%28%22OmniFocus%20Tutorial%22%29%0A%09project%2Etask%2Esequential%20%3D%20true%0A%09project%2EcompletedByChildren%20%3D%20true%0A%09var%20tutorialTopics%20%3D%20%5B%7B%22title%22%3A%22Introduction%22%2C%22page%22%3A%22index%2Ehtml%22%7D%2C%7B%22title%22%3A%22Console%22%2C%22page%22%3A%22console%2Ehtml%22%7D%2C%7B%22title%22%3A%22Inbox%22%2C%22page%22%3A%22inbox%2Ehtml%22%7D%2C%7B%22title%22%3A%22Due%20and%20Repeat%22%2C%22page%22%3A%22task%2Ehtml%22%7D%2C%7B%22title%22%3A%22Tags%22%2C%22page%22%3A%22tag%2Ehtml%22%7D%2C%7B%22title%22%3A%22Projects%22%2C%22page%22%3A%22project%2Ehtml%22%7D%2C%7B%22title%22%3A%22Plug%2DIns%22%2C%22page%22%3A%22plug%2Din%2Ehtml%22%7D%2C%7B%22title%22%3A%22Cleanup%20and%20Restore%22%2C%22page%22%3A%22cleanup%2Ehtml%22%7D%5D%0A%09var%20baseURL%20%3D%20%22https%3A%2F%2Fomni%2Dautomation%2Ecom%2Fomnifocus%2Ftutorial%2F%22%0A%09tutorialTopics%2EforEach%28topicObj%20%3D%3E%20%7B%0A%09%09var%20tsk%20%3D%20new%20Task%28topicObj%2Etitle%2Cproject%29%0A%09%09tsk%2Enote%20%3D%20baseURL%20%2B%20topicObj%2Epage%0A%09%7D%29%0A%09var%20projectID%20%3D%20project%2Etask%2Eid%2EprimaryKey%0A%09URL%2EfromString%28%22omnifocus%3A%2F%2F%2Ftask%2F%22%20%2B%20projectID%29%2Eopen%28%29%0A%7D%20else%20%7B%0A%09var%20projectID%20%3D%20matchedProjects%5B0%5D%2Etask%2Eid%2EprimaryKey%0A%09URL%2EfromString%28%22omnifocus%3A%2F%2F%2Ftask%2F%22%20%2B%20projectID%29%2Eopen%28%29%0A%09var%20alertMsg%20%3D%20%22A%20project%20named%20%E2%80%9COmniFocus%20Tutorial%E2%80%9D%20already%20exists%2E%22%0A%09new%20Alert%28%22Existing%20Project%22%2CalertMsg%29%2Eshow%28%29%0A%7D%7Dcatch%28err%29%7Bconsole%2Elog%28err%29%7D

TRY THIS! Use Omni Automation to install a new project in the OmniFocus database on this device, to assist you in keeping track of your progress with this tutorial!

tutorial-tracking-project

For reference, here is the tutorial course outline.

In the first section, you’ll learn how to enable the interactive features of this tutorial.