Using TaskPaper Templates from Drafts and Adding Variables from KM

I like writing and housing TaskPaper templates in Drafts, with the ultimate destination being OmniFocus.

I also like using Keyboard Maestro to set up projects based on those templates (e.g., create folders in Finder, other drafts in Drafts, etc.). For years, I wrote these templates in Drafts and then copied and pasted the text into an Insert Text by Pasting block in KM.

This allows me to have the KM variables in the notes in my OmniFocus tasks. However, I need to remember to copy and paste the template text from Drafts to KM when I edit the template.

My Question
I am hoping to automate the updating of these templates.

I am trying to have KM pull the template text from Drafts when the macro runs and then replace variables from the template text with the unique variables created KM when the macro runs.

Any advice? Right now, I have tried running the following sequence at the beginning of the macro (before variable creation) and at the end (but before pasting into OmniFocus). Neither sequence has worked; both result in the properly formatted OmniFocus project being created, but with the variable placeholders, not the actual values.

To get the actual values in there try this action after filling your named clipboard:
KM 0 2021-08-18_15-10-39

(obviously put the name of you clipboard in at (1))

The purpose of the Filter action is to replace all the tokens (stuff with %-signs around them) with their actual values.

I hope this is what you intended but I have not been able to test it so do have a go and let us know how you get on!

This did it, thank you very much!

Now I get to update a bunch of macros with this new feature; you made my day! :grinning:

1 Like