Reminders for later with Launch Center Pro, GoodTask and Text Expander

In the earlier days of this blog, I wrote about using Text Expander to set tasks for upcoming days, pretty much like Mailbox but applicable to any app with due date support in their url schemes. We’re running the extra mile today and I'll re-introduce you to operations with dates in Text Expander and how to use them in a Launch Center Pro list to set your reminders in GoodTask.

Creating date snippets in TextExpander

Before moving forward, let’s consult GoodTask’s documentation and find out what formats the dueDate parameter supports.

HH:mm - Sets on time today. If it has been passed, sets on tomorrow.
MM-dd - Sets on the date on default time.
yyyy-MM-dd - Sets on the date on default time.
MM-dd HH:mm
yyyy-MM-dd HH:mm

I love the first one for regular tasks, such as my Groceries After Work action, but in the general context we need more than that. Don’t expect this action to replicate the versatility of our next saturday script as that still requires Pythonista or an app with natural language support, such as Fantastical 2.

I’ll stick to the MM-dd format for this first part; we’ll study a way to include specific times later on. If you open Text Expander, I’ll use the Mac version for the example, and create a snippet for the current day following the GoodTask format, you’ll get %m-%d. Save this one with a fancy abbreviation, I use &!d, since I don’t want to expand this everywhere.

Now let’s create our snippet for tomorrow, you’ll find an option for Date Math and may come up with something like %m-%@+1D, but that will expand into the current month and a dash because you do need an object to perform the operation, so we add the date math followed by our entire date snippet, ending up with %@+1D%m-%d. We can create other snippets and I always end up with something like this:

Label Abbreviation Snippet
Today &!d %m-%d
Tomorrow &!t %@+1D%m-%d
3 Days Later &!l %@+3D%m-%d
Next Week &!w %@+7D%m-%d
Next Month &!m %@+1M%m-%d

You can download these snippets here.

Using our snippets in a LCP list

Next, we’re going to create our list in Launch Center Pro; for our snippets to expand not only the list must be wrapped in double brackets, but each abbreviation must also be wrapped in chevrons. I’ll include line breaks in the next example so you can visualize the list structure without using a ruler on the screen:

[[list:Pick a Date|
3 Days Later=<&!l>|
Next Week=<&!w>|
Next Month=<&!m> 

Why do we need a non-encoded list ([[list]]) instead of an encoded list ([list])? Launch Center Pro prompts for the list before expanding the snippets, so after you pick an option, you’re sending the encoded abbreviation to the next app, which will decode it into a regular string. Using a non-encoded list forces LCP to expand the snippets before launching the next app. This works because the characters we’re using to form our date don’t require additional encoding, they’re only numbers and hyphens, if we were separating our values with spaces, they’d have to be included as encoded values in our Text Expander snippets.

Creating our GoodTask action

Before selecting the due date for our reminders, we need one, so we start our Launch Center Pro action with a prompt requesting for text input:

goodtask://add?text=[prompt:Set your reminder]

Then we insert our list in a due parameter:

goodtask://add?text=[prompt:Set your reminder]&due=[[list:Pick a Date|Today=<&!d>|Tomorrow=<&!t>|3 Days Later=<&!l>|Next Week=<&!w>|Next Month=<&!m>]]

Surprisingly, we’re actually done. You can bounce back to Launch Center Pro afterwards by modifying the action a tiny bit:

Remind me Later:

goodtask://x-callback-url/add?text=[prompt:Set your reminder]&due=[[list:Pick a Date|Today=<&!d>|Tomorrow=<&!t>|3 Days Later=<&!l>|Next Week=<&!w>|Next Month=<&!m>]]&x-success={{launchpro://}}

Don't launch the action just yet, as you must update your Text Expander snippets manually in Launch Center Pro, just tap the cogwheel icon for the settings and you’ll find a large Update Text Expander Snippets button waiting for you.

You’ll notice after triggering this action that your reminder is created with a preset time, it is 8 AM here and you can set that under the Preset Time label in the Settings menu of GoodTask. A good way to avoid that and turn your reminders to move exactly 24 hours in your tomorrow snippet is to append the time to it.

Adding times and mixing everything together

There are many ways to include hours to your actions, you can always create a full list with times and append to the due parameter or another set of Text Expander snippets for versatile time management, the same math we used for dates also apply for the hour. Since GoodTask supports many kinds of input as due dates, you can mix different snippets together, like one for 3 hours from now using the HH:mm format, which would turn out as this snippet: %@+3h%H%3A%M, because, remember you must encode characters on the snippet and your colon should actually be %3A. A single snippet for tomorrow, 3 hours from now would be: %@+1D%m-%d%20%@+3h%H%3A%M, where we manually encoded the colon and the space (%20).

As long as your snippets expand to one of the 5 formats supported by GoodTask, you’re good to go. You can always create a second list to pick up the time, however, that would force you to always include an hour to your due dates unless you set one of the values of your hour list as a single empty space, then GoodTask will be kind enough to use the preset time.