Things Perspectives Alfred Workflow

I want to share my Alfred workflow to quickly open lists in Things with you.

The configuration is not very user friendly, but the workflow it self it very usable.

There is some German sprinkled around, feel free to edit it in your version …

Download link

Readme:


Things Perspectives

The main use case of the workflow is to quickly show desired lists in Things. Those lists can be either lists predefined by Things or custom search queries defined by the user.

Requirements

python 3

Use cases/keywords

th + query

Shows any list, by default in a new window. Pressing opens the list in the frontmost Things window.

The predefined lists are any project, area or tag list, or any of the special lists like today, tomorrow, etc …

Additionally, saved searched can be defined in the file writeThingsTargets.applescript. They follow the usual Things query syntax.

After opening a new window, +/ is triggered by applescript to close the sidebar.

The workflow works with a cache file for performance reasons. The cache is updated after running the workflow. If you create a new project, you cannot find it when running the workflow the first time after creation of the project. Either run the workflow anyway, wait a bit, then try again, or use the next keyword.

threload

Update the cache.
Using applescript/JXA is quite slow. To work around this, a file for the Alfred script filter is prepared from the Things database. This file is updated every time the th +query workflow is run. threload allows to trigger this update separately and triggers a notification, when the file is updated.

thc

Count selected tasks in Things.

thac

Count all tasks in the anytime list filtered by a tag specified in the “Run Script” action that follows the thac keyword.

Alternatives/Considerations

There are other workflows that query the Things sqlite database directly. From what I saw they did not allow for saved searches. I have no intention of querying the database directly. Using the JXA API is more readable (in my opinion), definitily simpler and hopefully provides a more stable interface should things change in the way Things stores its entities.

The downside of the applescript/JXA API being slow is countered by using a cache.

1 Like

Thanks. I’ll try it out.

However, I already have a workflow where I tap ⌥ + T globally and it open Things. I can start typing the list I want to search (things supports this out of the box). So this might not reduce any keystrokes for me.

Your solution allows also to search for tasks.

My solution also has saved searches eg lists filtered by task. If you use those frequently you might save a few keystrokes.

I found that opening a new Things window takes some time. With the workflow you don’t have to wait. So instead of keystrokes I save my sanity (because I am impatient). After I have typed what I want I am ok to wait for it to happen. Personal preference.

Just do however you like!