At the end of each work day, I have a project in Things where it lists all my daily shutdown tasks that I review.
The last item on my daily shutdown project is to create the next day’s shutdown project.
While the process to manually create this project doesn’t take long, doing it over and over each day can get tedious.
So with the help of Shortcuts and the Things URL scheme, I was able to create a shortcut that:
- Takes a project that I use as a template
- Rename it to indicate it’s the next day’s shutdown project
- Move it into the Things Area where I like to keep my shutdown project.
What’s a shutdown routine
A shutdown routine is a simple list of things that you might do at the end of your work day.
For me, it indicates to my brain it’s time to get ready to stop work and helps me get ready for the next work day.
My shutdown routine includes answering some questions of reflection and tidying up my physical and digital workspaces.
Templates in Things
The way I replicate my shutdown routine on a daily basis is that I use a “template” project in Things.
A “template” project in Things is just a project that doesn’t get actively used but has tasks and headings of repeating projects.
In other words, it’s just a source for the active project I will create from it.
In Things, I have an Area called Templates.
This is the place where I keep all my template projects and where my daily shutdown project resides.
Manual process
Prior to my shortcut in order to create the following days’ shutdown project, I’d have to:
- Right click to duplicate the project
- Drag and drop the project into my active projects area
- Rename the project to the next day’s date
- Take the first task in the project and set the When to tomorrow.
A four step process.
Duplicating projects with Shortcuts and the Things URL scheme
In Shortcuts, Things provides an action that allows you to Run Things URL. What the URL is referring to is the Things’ URL scheme
URL schemes are exposed by app developers to allow users to then run the URL with specific options to then have the app do things.
In order to have Shortcuts run the task of duplicating and manipulating a project, I used the update-project
command.
The final URL the Run Things URL action runs is this:
things:///update-project?auth-token=[Token]&id=[Daily project id]&duplicate=true&title=[New URL encoded title]&area-id=[Area id]
Let me break down what each part of the URL does.
things:///
indicates that this is the Things URL scheme.
update-project
Indicates the command we’d like to run in Things via the URL scheme.
?
in URLs a question mark indicates what’s called a parameter. The first parameter after a URL always starts with the ?
symbol.
auth-token=[Token]
is the first parameter with the value passed to it. The value being what comes after the =
which is [Token]
. The token is what’s provided by Things.
The token is necessary because we’re manipulating data – in this case the name of a project.
The square brackets are not required and are just used for style purposes to indicate it’s a value you set yourself.
So in this case of the token from Things is 1234
The parameter and value would look like:
auth-token=1234
&
every parameter after the first in a URL will start with the ampersand.
id
Indicates the ID of the project.
duplicate
Indicates that id like to take the project I pass to the command and duplicate it.
title
is the new title of the duplicated project that’s URL encoded.
URL encoding takes a string and makes it safe to be used in a URL by converting certain characters into its URL-safe equivalent.
area-id
Is the ID of the area where the new duplicated project will be placed.
Gathering all the necessary IDs and token from Things
For this Shortcut to work, you’ll need to get three things from Things:
- 2 IDs – one for the project to duplicate and the other for the Area you’ll place it in
- 1 Things authentication token
Getting the Things authentication token
First let’s get the authentication token. To do this, you’ll go to Things > Preferences > General
then click the Manage button next to the Enable Things URLs option. You’ll find your token under the heading Authentication Token.
Get ID of Projects and Areas from Things
To get the ID of a Project or Area in Things, you’ll want to right-click on the Project or Area, then go to Share in the menu, then click on Copy Link.
This will copy the Things specific link like:
things:///show?id=5MBEHV2jnVZAR1T7Q28HnE
The characters after the id
is the ID of the Project or Area.
Setting up Shortcuts to duplicate a Things project
To get Shortcuts to duplicate a Things project, I actually set up two shortcuts.
One shortcut is used to simply hold the Things authentication token and pass it to my main shortcut.
A second shortcut to put together all the pieces of the URL scheme to then run in Things and duplicate the project.
Apply Things token to first shortcut
For the first shortcut, all it is is a single action shortcut.
The action is a text action and the value set for the action is the Things token.
Replace [Things token] with the actual token from Things that we got earlier.
The reason why I do this is, the next shortcut I create will use the Run Shortcut action which will then run this shortcut and it’ll pass the token to the new shortcut.
This allows me to define the Things shortcut once and potentially use it across multiple shortcuts in the future.
Piecing together the Things URL to run in shortcut
In this section, we’ll piece together the second shortcut. Essentially it’s putting together all the pieces we gathered from Things and getting it prepared to run in the URL scheme.
Here’s what the entire shortcut looks like.
As you can see in the shortcut, there’s really 2 (maybe 3) areas you’ll want to update.
The first action, we’re using the Run Shortcut action to run the Shortcut we made earlier to store our Things authentication token.
Since the output of that Shortcut is the token, the next action we’ll use is Set variable. I set the variable to Token and the input is the results of the previous action.
Next, in a Text action I put the ID of the Things Area. This is the place this shortcut will put my project once it’s duplicated.
I pass to another Set variable action that is set to Area
Like in the previous section, we’ll also set a pair of Text and Set variable actions for the ID of the Things Project – the template project you want to duplicate.
This time setting the variable to Daily project.
Now you’ll want to rename the title of the Project. I like my title for my daily shutdown project to be, “🌒 4/19 Daily review”.
So the first action you see is the Date action. I’ve set the Date action to ask each time the shortcut is run. The reason for this is, I can control the date based on if I’m creating this on a week day or on Friday. If it’s Friday, I’ll want Monday’s date and not Saturday’s.
The date then gets passed to a Text action that has the part of the title that never changes.
When the results of the Date action is received from the Text action, I ask for it to be formatted as M/d
by updating the Date Format option to Custom.
Since this title will eventually be passed as a URL, I have to URL encode it using the URL Encode action.
Finally, I pass the new title to a Set variable action and set it to New title.
Now that I have all the parts of the URL I need, I put the full URL together in another Text action.
Here’s the URL again for easy, copy and pasting:
things:///update-project?auth-token=[Token]&id=[Daily project id]&duplicate=true&title=[New URL encoded title]&area-id=[Area id]
Wherever you see the square brackets, just replace it with the variables that were created above.
Once you’ve got the entire URL, pass it to the Run Things URL action.
I also changed the option Show When Run to off, for the Run Things URL action.
Now when you hit the play button on the shortcut, you should be able to go to Things and see your newly duplicated project.
If you’ve got Shortcuts and Things set up on macOS and iOS, the shortcut will work seamlessly across both platforms.