OmniFocus: Using the iOS URL Scheme
Posted:
Updated:
URL schemes are indispensable to anyone who uses iOS heavily and dabbles in automation. They allow users to make deep-links into apps and to automate actions using apps such as Siri Shortcuts, Editorial or Drafts. Because Shortcuts is in beta until iOS 12, I will use Workflow until it is released and I can update this post.
Thankfully, the OmniGroup who is behind the incredibly flexible and powerful task manager, OmniFocus, has an extensive and well-documented URL scheme! I will link to the original web pages documenting the scheme but will go through the format and usage of some of the more useful URLs. A common and user-friendly way to use URL schemes is through Siri Shortcuts (formerly Workflow). I will give some examples of how the schemes could be used with Shortcuts and for more a more in-depth scripting usage you may refer to an OmniForm post written by Ken Case.
URLs in Apple Shortcuts
In order to open a URL in Siri Shortcuts simply place a URL action and populate it with the URL you desire and follow it with a Open URLs action.
URL Structure
For those new to URL schemes on iOS, the base URL structure somewhat resembles a browser-based URL.
appSlug:///
Deep Linking into OmniFocus
Home Page
The most simple URL for an app is one without path or arguments. A URL of this form would simply open the home page of the app. For OmniFocus this is as follows:
omnifocus:///
Inbox, Flagged, Projects, Nearby, Contexts & Review
These views are the main staple of any OmniFocus user and you can speed up your usage of them by creating shortcuts to them using the following schemes:
omnifocus:///inbox
omnifocus:///flagged
omnifocus:///projects
omnifocus:///nearby
omnifocus:///contexts
omnifocus:///review
It is very simple to create a Shortcut where you select which view you would like to open using a Select from Menu action and a Open URLs action at the end. I have made this shortcut as a demo - get it here!
Check out my example OmniFocus quick view flow here.
Forecast, Past, Today, Soon & Custom Perspectives
If you are keen to link to any of the perspectives built into OmniFocus or to one of your own custom perspectives, this is achieved easily like before!
omnifocus:///forecast
omnifocus:///past
omnifocus:///today
omnifocus:///soon
And if you want to link to a custom perspective that you have created (e.g. My Awesome Perspective), you can simply do this:
omnifocus:///perspective/My%20Awesome%20Perspective
One thing to note here is that if your perspective has any characters other than letters or numbers, you should URL encode it! Thankfully, Shortcuts has an action that does just that. An example of how you might do it is below.
Check out my example OmniFocus perspective opening flow here.
Searching
You can also open up a custom search straight off the bat by using the search URL. This can easily be augmented by replacing the string below with an Ask When Run
variable.
omnifocus:///search?q=string
It is important to note that the ‘search’ string should be URL encoded as demonstrated earlier.
Check out my example OmniFocus search flow here.
Opening a Folder
You can also simply open a folder using the folder URL much like the search URL.
omnifocus:///folder/folder-id
It is important to note that the ‘folder-id’ string should be URL encoded as demonstrated earlier.
Check out my example OmniFocus folder opening flow here.
Opening a Project
And following the above trend, you can also open to a project with a similar URL.
omnifocus:///task/task-id
It is important to note that the ’task-id’ string should be URL encoded as demonstrated earlier.
Check out my example OmniFocus project opening flow here.
References
- Siri Shortcuts: https://www.imore.com/siri-shortcuts-faq
- OmniGroup: https://www.omnigroup.com/
- OmniFocus: https://www.omnigroup.com/omnifocus/ios
- Editorial: http://omz-software.com/editorial/
- Drafts: https://getdrafts.com/
- OmniForum Post: https://discourse.omnigroup.com/t/implementation-details-for-omnifocus-2-14-automation/24179
- Ken Case: https://twitter.com/kcase
- OmniFocus Quick View Shortcut: https://workflow.is/workflows/f78d4e2303454a7fbbd8346dd41925c5
- OmniFocus Perspective Shortcut: https://workflow.is/workflows/329d62f5c5ce41669fecd8e86a3bf0a2
- OmniFocus Search Shortcut: https://workflow.is/workflows/90e65b30ddcb43af864c06e312e0a6be
- OmniFocus Folder Shortcut: https://workflow.is/workflows/c65cdd98379d49e5bf9261087d4267b4
- OmniFocus Project Shortcut: https://workflow.is/workflows/d41a3ec96ec349a68cc6307fd265373f