Inserting variables in Things 3 URL scheme

I want to use Shortcuts to generate a new project in Things 3. This can only be done by using a URL Scheme. I know you can use Drafts 5. But I want to run a ‘create project’ Shortcut in another (multi-step) shortcut. My multi step Shortcut will generate a project name as a variable. I want to insert that variable into the URL-scheme. A bit like this (replacing [VARIABLE] with the project title)

things:///add-project?title=[VARIABLE]&tags=%40Work&area=Work

Does anybody know if this can be done?

I have a Shortcut that does the same sort of thing, so it does work. You will need to URL encode the contents of the variable.

1 Like

You’ll also need to convert to an x-callback-url format as indicated on the support page as you are making it a multi-step shortcut and will need Things to return operation back to Shortcuts once it has completed its processing.

1 Like

I’ve just had a look back at my example and remembered that there is actually a specific action to “Run Things URL” rather than using the x-callback-url method.

This creates the project and then the Shortcut continues and populates the actions in the project.

2 Likes

That has to be the strangest implementation of the (relatively) new Shortcuts actions I’ve seen to date, combining a URL scheme into a action rather than the parameters :astonished:

Agreed, took me a while to realise that it was not a deprecated action and is, in fact, the only way of creating a project.

1 Like

Cheers guys. I think you got me to where I needed to be :grinning:

1 Like