Using Hook with TaskPaper3

Hook turns out to be a useful instrument for creating links to TaskPaper documents which can do more than just open their filepaths.


I never heard of hook until I read your post. I am including a link to a brief overview of what you can do with it. It is an app that helps you “hook” into relevant information to what you are working on so that you can spend more time work creating and less organizing or remembering.

It is hard to explain, but think about a program like Devonthink. If you are familiar with Devonthink you know that you can use folders or tags to organize your information inside the database and keep it organized so that when you do some research or work on something, everything is easily available WITHIN Devonthink.
Well. Hook tries to do the same thing, but instead of being centered around one program, it is centered around the programs you are using to work at the time. For example, If you are working on a project using Devonthink as an organization tool, devonthink becomes the middle step in the process. So that as you are typing something using Ulysses and you want to find the references in BibTex or your outline in TaskPaper or your illustrations in omnigraffle, or your web bookmarks. Instead of moving from Ulysses to Devonthink to whatever you want to access and then back, you can use hook to have everything related to your workflow with a couple of keystrokes without having to go through the Devonthink. Your files are stored wherever, they are opened using your preferred programs, and the hook links are pretty robust (if you move files around, they remain “hooked”)

It is honestly genius. In a sense, you can use this instead of Devonthink, but I really enjoy the serendipity of browsing my Devonthink databases and using their “AI.”

You can also combine this with “bunches” by Brett Terspra so that you open all the programs and files related to a particular workflow (called a "bunch) and then use Hook to move between the relevant files of each file within your workflow.

I am adding this explanation just in case you get confused about what is hook, but check the video if my explanation didn’t help.

Now, the script linked above is and example of a “complex” interaction and link creation using hook and TaskPaper. @complexpoint, would it be possible to explain a couple of scenarios of how you would use your scripts with taskpaper and hook in a hypothetical situation? I think that would help people understand it and use it.


My own main use at the moment may be a little too specialised for general interest.

I’m assembling a body of teaching materials using Tinderbox, which is a useful environment for structuring and refactoring such things, with visual maps which can be made to interact with outlines.

but I have a very strong preference for thinking and outlining in TaskPaper, the @key(value) tags of which map directly to Tinderbox attributes. (Why the preference ? Tinderbox outlines are a bit too modal and visually cluttered for me – I much prefer the TaskPaper / WriteRoom level of focus and speed).

That means that for any section of my Tinderbox document there is likely to be an outboard TaskPaper file – a kind of building site where the real thinking is happening. Or to put it another way, for many of my TaskPaper files, there is a corresponding point in the underlying Tinderbox outline.

Hook gives me a quick and light way of making and using two-way links between these corresponding Tinderbox notes and TaskPaper files.

(and, of course, I have a couple of translation scripts for movement of tagged outlines in either direction).

Eccentric bonus – some of these files also have Hook links to particular Spotify tracks, while I solemnly assure myself is a genuinely helpful way of moving quickly back into a particular tone and focus : -) Perhaps … but its fun, anyway.

A PS - we could write Hook scripts which created links for the selected TaskPaper line (I remember a clever and elegant piece of code in Jesse’s FT JavaScript which generated unique and rather compact paths for a given line), and perhaps that could be useful if anyone is making use of TaskPaper 3 documents which are relatively stable in their structure. For the moment, the Hook scripts linked to above just restore filter state.


Wow, I am impressed. This looks like one of those, “where have you been all my life” solutions. I will definitely give Hook a try.

I use NVAlt all the time for my random notes and thoughts, but I have not heard of “Bunches” by Brett Terspra before. Will have to look into that too.


45 posts were split to a new topic: TaskPaper ⇄ Tinderbox import export

I’ve recently tried setting up Hookmark with the scripts in the original post. I manage to get the URL, which begins with taskpaper://.

However, opening the link seems to fail. MacOS (Sonoma) complains that there is no application installed that can open the URL, and when manually searching for TaskPaper in the app list, the app is greyed out. That said, I am using the SetApp version of TaskPaper.

What am I doing wrong?

Sorry I’m not sure. I think you will have better luck asking in the Hookmark app’s forums. TaskPaper doesn’t handle taskpaper:// links, it’s actually Hookmark that is supposed to do that. And then it calls into TaskPaper’s AppleScript dictionary to set the proper state.


A small update. I managed to get this working to a degree.
The script will have no problem working with filter states like this:
(@today or (@due <[d] tomorrow) union (@today or (@due <[d] tomorrow))/descendant::note) except @done///*

But will not play well with stuff like this:
(@priority = high or @today or (@due <[d] next week)) and not (@done)
In this case, I will only get (@priority into the filter box (including the extra space before the ‘=’.

It will not apply any filter in this case unless I remove the “” around “setting”.
@resolution contains[l] "setting"///* and @type=task///*

Seems like an issue with parsing in the process somewhere, but it works well enough for basic filtering, so many thanks @complexpoint for this!


I think those double quotes would, in the context of a string passed to a script, probably either need to be"

  1. escaped ( \"setting\" ) , or
  2. replaced with single quotes ( 'setting' )

(but only experiment will reveal)

1 Like