Question about Hook to New with Things 3

Hey all. I really see the potential with Hook and I’m very impressed so far! One thing I can’t figure out though is a deeper Hook to New Things task. Currently if I Hook to a new task, the title of the hooked link shows up as a new task but there is no actual hooked link. Hopefully this is already a feature and I’m just missing it! If not though, here’s the details.

For example, Craft introduced their Connect feature where you can select a block and add it as a task to Things, but when you open the Things task a callback URL to the specific block is in the notes section of the task. Is there a way to emulate this with Hook?

My use case is this - I want to add an email from Spark to my Things list with a link to the email in the notes of the task for ease of opening. However, only the subject line of the email is represented in the task, no link to the actual email. This results in having to go back to the email and copy the link in Hook then going back to the task created by Hook and pasting it. Quite a bit of friction.

I’d say the idea for Hook is to invoke the Hook bar with the Things item selected (Shift+Command+Space), and that way you get immediate access to all the hook links attached to that item. If I wasn’t going to use Hook that way I would just use the Quick Add in Things with Things helper (set to Ctrl+Option+Command by default I believe).

However, I also like to use Things on my iPad and iPhone, and Hook isn’t there yet, so I edited the script a little (cannibalising bits of the OmniFocus Hook to New Script). So my script does exactly what I think you’re asking for. If you open the Hook Preferences Window, go to scripts, and select Things, you can replace what you currently have under “New Item” with this:

tell application id "com.culturedcode.ThingsMac"
    set new_todo to make new to do
	set AppleScript's text item delimiters to {"$$$"}
    set srcURL to text item 1 of "$link"
    set name of new_todo to "$title"
	set notes of new_todo to srcURL
    set todo_url to "things:///show?id=" & id of new_todo
    edit new_todo
end tell

The links to Finder items and a few other things won’t work in iOS unfortunately (basically, if it doesn’t have a URL scheme it will produce a Hook link instead).

This is exactly what I was looking for! It is unfortunate that hooked items won’t show up on iOS, but I do most of my heavy lifting stuff on my MacBook anyway so this works perfectly.

I found too that with Spark, you can link Things to Spark to enable easy adding with a url to the Spark message, but I’ll definitely be using this for everything else. It has already come in handy for Outlook messages that I need to get to at a later date. Thank you so much for this!

1 Like

No worries, my script stands on the shoulders of scripts that came before it :slight_smile: I also found someone else here had made more or less the exact same thing before I did.

1 Like

I’ve run into an issue that I can’t figure out (mostly because I don’t know AppleScript). It works just like it needs to, but it looks like it encodes the & sign in the link to %26 which then breaks the link. I’ve tried a lot of different things in the script to find and replace, but at the end of the day I don’t know exactly what I need to look for to fix it. I’m also not sure if this is a Hook, Things, or AppleScript issue.

Okay, I figured it out. I changed $link to $user_link per a different thread.


Great stuff! I’ll do the same!