For the past couple of years, I’ve used an AppleScript on the Mac to template birthday projects in OmniFocus. I had a set of tokens in OmniFocus task notes which described how the AppleScript should run, which would then import the templated project back into OmniFocus. The downside of this approach was that I needed to be on the Mac to clear the reminder task for each birthday.
With the advent of the task share button in OmniFocus 3, I decided to translate the process to Workflow. Importing my note tokens, I ended up with quite a long workflow before I’d even arrived at the main flow… Then, I noticed the Get Dictionary from Input action and I realised that I could get straight to the properties if I formatted the note tokens as a JSON dictionary.
Setup
- Use a Workflow Action Extension
-
Get Item from List - Get:
First Item
-
Match Text - Pattern:
\{.*\}
- Get Dictionary from Input
- Set Variable
I’m not fully sure if the dictionary needs to be saved as a variable but it seemed to make it simpler to access later. You can then use the dictionary and its values where you would use other variables or inputs by entering the placeholder and then tapping on it to type in the key you want to use.
Caveats
- The JSON dictionary can be the only place you should use curly braces
{}
in your OmniFocus reminder task. - Beware of smart quotes when formatting the JSON dictionary. I used Drafts and later TextExpander to make sure I kept straight quotes.
- The keys on a Workflow dictionary are hand typed on each use. Make sure you get them right or you won’t get the value you expect.
Use
- Add a JSON dictionary to the notes of an OmniFocus 3 task.
Example:
{"name":"Great Aunty Beryl","birthday":"19/09","gift":"yes","deliver":"no"}
- When the task becomes active, select it, tap the share button and run your Workflow.
- Watch your Workflow run and do whatever you’ve told it to.
The Benefits of Using OmniFocus as a WorkFlow Trigger
- You do not need to leave OmniFocus to act on your Workflow task.
- You can maintain a set of reminders (in my case, birthdays) and avoid a ton of repeating projects… Less for your weekly review.
- Pre-fill your Workflow fields and inputs for repeating tasks.
I hope this post sparks new ideas for ways Workflows can be used. My Workflow can be found here: OmniFocus Birthday but be aware that it’s designed for my OmniFocus setup. If you think the birthday date in the dictionary looks odd, it’s because I’m British. Any date formatting will unique to your locale and I could have also used month names in this case, just miss out the year as Workflow fills that for us.
Thanks for reading.