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 …
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.
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.
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.
Count selected tasks in Things.
Count all tasks in the anytime list filtered by a tag specified in the “Run Script” action that follows the
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.