Some of you may use Curt Clifton’s Populate Templates Script, and face the limitation that you can only execute the script to manipulate these on macOS—iOS being unable to execute AppleScript. I have created a pair of Workflows which replicate this AppleScript.
You start by sharing a project from OmniFocus to the Workflow, through the share sheet icon in the bottom right-hand side of the project inspector. It gets the TaskPaper which OmniFocus shares, and replaces each of the variables inside it. In the original script, variables are designated as follows
«variable»—and you are asked what you would like to replace them with. There is also an alternate set of scripts which can handle variables in the format
$variable, though if there are any prices in dollars in your script this would prove problematic.
The Workflow works as follows:
- It selects the TaskPaper from the items shared by OmniFocus.
- It removes some extra text which we do not want.
- It checks for variables and passes them to the second script for replacement if variables are present.
- It adds the TaskPaper to OmniFocus
The second Workflow works its way through any of the
«variable»s found, asking you what you would like to put in their place.
The beauty of this automation is the work is actually in the creation of the OmniFocus projects themselves—you can make it as complex or as simple as you like, and these Workflows will handle it. You also don’t need to make changes to the Workflows to make them work for you (unless you want a different variable format, in which case you will need to tweak the
Match Text actions). You also can use the same templates on macOS and iOS, and merely need the AppleScript and the Workflows to take advantage of them.