Change variable syntax to accommodate Things 3 URL scheme



I am interested in exploring how I can use KM to integrate with URL schemes in Things 3, which the developers recently made available:

The issue I’m running into is that these links use a lot of percentage signs, which is the same syntax that KM uses, so those links get messed up (since KM is trying to interpret these percentage signs as variables). Is there some sort of way around this?

For example, a base “create new task with X text” would look like this for the URL scheme:


The three percent signs there screw stuff up. Any ideas? Thanks!


Not all KM text contexts process tokens.

One approach, for example, would be to let an Execute JS action:

  1. Perform the url encoding
  2. Open the encoded url

(() => {

    // standardAdditions :: () -> Application
    const standardAdditions = () =>
        Object.assign(Application.currentApplication(), {
            includeStandardAdditions: true

    const strURL = encodeURI(
        'things:///add?title=test to-do item here'

    return (



Build and open url.kmmacros (1.9 KB)


and in the options gearwheel at the top right of the open URL action:



Yep, just set the Action Gear menu options to "Process nothing":



I hate to bump an old topic, but has anyone gotten this working? I have the exact same URL working in the Shortcuts app, but when I try to run it on my Mac, Keyboard Maestro tells me it's an invalid URL. I've tried setting the action gear for the URL action to both process text normally and process nothing, and both result in the same error.


No worries about bumping the old topic; people do that all the time here. As for your question, it's hard to say what might be going on without seeing the URL in question. Can you share it here, along with the macro you're using to try to open it?


Sure thing. Here's the URL:


Like OP, I am trying to pass variables into the Things 3 URL scheme to function as a template. I've successfully made a similar workflow using Shortcuts for my iOS devices. I've also been able to create an Alfred workflow, but I much prefer the interface of KBM.

Here's the full macro.


Note: I can copy that same URL onto my iOS device or open it via Google Chrome on my Mac and it works just fine minus passing the actual variables, so there doesn't seem to be an actual issue with the URL but KBM thinks there is.

Also, I've done some testing and KBM seems to have no problem with the first part of the URL. As soon as I enter %Variable%Title% the Open URL text turns orange to report an error.


Thanks for sharing. As you suspected, KM is indeed getting mixed up with the % signs used for variables and the ones used in percent encoding for URLs. The way I'd go about resolving this is to assemble the URL in a KM variable first, run a filter on the entire URL to percent encode it, then open the encoded URL variable:

New Book Project.kmmacros (3.4 KB)



This also has the advantage of making it easier to change the resulting to-do item, since you can edit the title, checklist, notes, and other fields in plain text without worrying about hard-URL encoding everything.


Note that Keyboard Maestro itself does not care anything about the format of the URL, however the URL is stored within a system NSURL object, and NSURL will only allow valid URLs, so it is NSURL that is rejecting the URL as invalid.

Also note that if you are processing text tokens (as controlled by the gear menu in the action), then you must deal with the fact that % is special to Keyboard Maestro, and so where you want an explicit % sign in the URL you need to double it, so eg:


@gglick’s solution is a better solution, since all the % tokens in the Set Variable action are intended for Keyboard Maestro to process, and all the percent tokens needed in the URL are created by the Filter action.


Sorry for such a late reply on this. The end of the year got away from me with completing my Masters and the holidays. This is exactly what I needed. Thank you so much. Seeing it broken down this way helped me port over all my existing Omnifocus templates and I'm back in business with Things. My workflow and frustration levels thank you!