Creating Project Templates for Things 3 with Shortcuts and Keyboard Maestro

If there’s one thing I’ve missed since moving from OmniFocus to Things, it’s the ability to use project templates. It’s hard to beat Omnifocus’s support for the TaskPaper format. Project templates can be created in a flash and added by simple text expansion tools.

That being said, it’s also hard to beat the design of Things, and for that reason, I set out to learn how to convert my templates.

In migrating to Things, I decided a number of them would be better off just scheduled as repeating projects in Things, which cut my list in half before I even started. Working at a university, most of my work tends to repeat each semester, but the actual dates of semesters tend to fluctuate slightly, so my projects tend to do so as well. I can, however, count on those projects happening roughly around the same weeks each year. With Omnifocus 2, it wasn’t possible to schedule a project to repeat yearly on say the first Monday of November, but it was in Things 3. It’s worth noting that repeats like this were added to Omnifocus 3, so if I were still using it, I’d have moved these templates back into Omnifocus too.

Unlike Omnifocus’s TaskPaper format, templates in Things 3 are possible through a URL scheme. If you’re interested in testing it out, Cultured Code has a really nice Link Builder to help you get started. While this works great for static projects and actions, it doesn’t let me create the variable templates I was trying to create.

Naturally, I turned to the trusty Keyboard Maestro to see if I could pass variables into a Things URL. It turns out Keyboard Maestro’s variable format doesn’t really get along well with Things’ URL scheme though. All those percentage signs make for a confused mess. I even found a post on Keyboard Maestro’s forums asking for Keyboard Maestro to play nicely with Things URLs, which I nervously bumped 8 months later out of desperation.

After hours of frustration trying to get it to work and searching relentlessly for a solution, I stumbled upon a blog post that used Alfred instead. While I was at least able to get this working, entering the variables was nowhere near as user-friendly as having the dialog boxes that I had been used to while using Keyboard Maestro. That being said, if you’re an Alfred fan, this may be just what you’re looking for!

Things Templates Using Shortcuts

At some point, I conceded that Keyboard Maestro wasn’t going to happen and tried my hand at creating them with Apple Shortcuts. Let me just say Shortcuts handled Things URLs beautifully. Having little to show for all my time dabbling with Shortcuts other than my Spotify playlist shortcut, I was surprised, to say the least.

The basic shortcut is only 5 actions (I’ve used my Book Project to help illustrate.):

  1. Ask for Input (e.g. What the’s title of the book?)
  2. Replace text (This finds spaces in whatever you inputted and replaces them with %20)
  3. Set Variable (In this case, to bookTitle) – I’m going to skip forward onto the remainder of the shortcut here for simplicity’s sake, but it’s safe to say you could keep reusing steps 1-3 to prompt for as many variables as you need. You can use them for any field supported by the URL scheme including (Notes, Tags, Deadlines, etc.) so there’s plenty of room for exploration.
  4.  URL (This is where you’d put your URL you got from Cultured Code’s Link Builder unless you’ve got the URL scheme down to which I’ll say Kudos! This is also where you’ll be replacing the fill-in areas with your variables from earlier. Admittedly this is kind of a pain because the URL is long, and the URL field in Shortcuts is a single line, but copy and paste works quite well if you’re using a keyboard.)
  5. Open URL – You’re done.

I was able to recreate all of my templates in Shortcuts fairly quickly by duplicating and then modifying this shortcut, and I can easily run them from Spotlight by typing in the name of the shortcut.

While I was glad to have my templates back in some form, it was fiddly having to grab my iPhone or iPad to generate a template when I was already on my computer.

Back to trying to get Keyboard Maestro to work…

Things Templates with Keyboard Maestro

Thankfully in the months since I’d bumped that post on the Keyboard Maestro forum, a kind soul by the name of gglick came to my rescue. (Note to self: Pay better attention to forum replies.) I really cannot take any credit for this because he or she really did the leg work to make everything work. Even better, the way it’s set up makes the template super easy to update – even easier than Omnifocus’s TaskPaper format in my opinion.

I’ll give gglick credit by linking to the post if you’re interested in the macro, but in short, the macro is 4 actions:

  1. Prompt the user for input (Note: Unlike with Shortcuts, you can add all the variables you want in this step.)
  2. Set Variable to Text (In this case, Keyboard Maestro is going to be doing most of the link formatting, so you can pretty much write out all your tasks in plain text with the exception of a few bits like the variables and the starting syntax.)
  3. Filter Variable with Percent Encode for URL (This turns all the spaces into %20 like Step 2 of the Shortcut earlier.)
  4. Open URL (Note: the URL you’re opening is actually the Variable you made in Step 2.)

As I did with Omnifocus, I’ve set up a macro palette to display the templates that I can trigger via the same keyboard shortcut (⌘+F4) I used with Omnifocus saving me from having to retrain any muscle memory. All this is is a macro containing the action “Show Macro Group”.

I know I spent countless hours trying to figure this out, so I’m sharing this in hopes it saves someone else time. Happy templating!

Photo by Andrew Neel on Unsplash

Advertisements

9 thoughts on “Creating Project Templates for Things 3 with Shortcuts and Keyboard Maestro

  1. Ken Walker says:

    Glad your figured it out! I was going to offer this blog post by one of the Shortcuts team members:

    https://thesweetsetup.com/articles/automations-workflows-things-ios/

    I couldn’t actually think of anything useful to do with Shortcuts automation. I know there are people on the web who have pulled off crazy IFTTT automations with their task lists—which sounds way too fiddly.

    I tend to like to try to curate my task list by hand. I like your approach of setting your own recurring annual projects. It got me thinking that might be useful for me for things like team reviews (which also happen annually) or taxes.

    • Andrea says:

      Hi Ken,

      I actually had looked over all the Things shortcuts at the Sweet Set Up. They’re great if you’re looking to create projects that are always the same, but I like to tailor mine with variables, so I needed to go a bit further.

      My latest fiddly automation actually does use IFTTT. I rarely get paper mail these days so I’ve fallen out of the habit of checking it daily. Instead, the USPS offers a service that will email you I’m scheduled to receive mail for that day. IFTTT looks for that email and forwards it to my inbox in Things. I’ve taken it a step further by having Keyboard Maestro run an Applescript that moves that task from my inbox into the proper area and assigns it the proper tags. Having never done anything with Applescript, I was surprised at how easy it was.

      As far as recurring projects, taxes is a great example. In addition to a taxes project, I also have recurring projects for our yearly review at work as well as more fun projects like decorating for the holidays. It’s one less thing I have to remember.

    • Andrea says:

      Headings are certainly a limitation of the URL scheme. Thankfully my project templates don’t require any, but I may have to check out Drafts again if I ever need them. Thus far Drafts just hasn’t clicked with me.

      Thanks for stopping by!

  2. CWM says:

    Hi there, I really enjoy your site. I think it’s really well done and I hope you’ll keep up with it!

    Would you have any idea how I can use keyboard Maestro to tell Reminders to remind me of something at a specific time (as in, “Remind me to do X in 20 minutes”)?

    I can’t for the life of me figure out how to do this! Any advice you have would be much appreciated.

    • Andrea says:

      Thank you! I’m glad you’re enjoying it.

      As far as using Keyboard Maestro (KM) to set reminders, that certainly seems within the realm of what KM could do, but I would really recommend exploring the KM forums. There’s a ton of great usecases and helpful folks there that have either already figured it out​ or would be willing to explore it more.

      Off the top of my head, I would imagine a combination of actions including Prompt User for Input (to set variables of what you want to be reminded of and the time), activating the application reminders, and a combination of either keystrokes or click mouse actions. That being said, something like this would be much easier to build in the Apple Shortcuts app given the native support for actions like what you’re trying to do are already built in.

      Hope that helps.

Leave a Reply to CWM Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s