Disappearing Hook links [CulturedCode changed the item IDs used in Things URLs]

I use Things App for my task management. I have had quite a few links between Things app to Outlook, many other applications.

Issue - Invoking Hook from Things app is not showing any linked links.
However, Invoking Hook from other app that has the link with Things app shows the link.

Not sure where the issue is at

Here are the example images of missing links when invoked hook from Things App2020-09-29_11-29-09


Welcome to the Hook Productivity Forum, @raghu. Thanks for letting us know about Things, which seemed to have changed the URLs that are returned by items. We are looking into it.

Hey @raghu,

In their latest update CulturedCode changed the item IDs used in Things. The URL for a todo used to look like things:///show?id=01809415-71DD-4662-ACBE-FB86B1680FE0 with a hyphen separated multipart hexadecimal identifier, and now looks like things://show?id=AQ6Pp76y4D17eQax74TTby with a shorter alphanumeric identifier.

The problem is that Hook can’t know that the new and old IDs both represent the same item, so when Things returns the new IDs for a todo Hook isn’t showing linked items because they are linked to the old ID.

The good news is that the change maintains backwards URL compatibility, so old links aren’t broken.

And it is possible to update all your old links to the new ID. I’ve created a script which can do that for you.

The bad news is that the script depends on some updates to Hook’s automation API which won’t be available until Hook 2.0 is released.

Here is that script. Remember this page and come back and run this (in Script Editor.app, in your Utilities folder) as soon as Hook 2.0 is released.

-- before running this, or any script which will modify data, 
-- back up that data, just in case. 
-- Make a copy of your Hook folder, which you can find at 
-- ~/Library/Application Support/com.cogsciapps.hook
tell application "Hook"
	set thingsURLs to address of every bookmark whose address begins with "things:///"
	set AppleScript's text item delimiters to {"things:///show?id="}
	repeat with addr in thingsURLs
		set oldID to the second item of every text item of addr
		tell application "Things3"
			if exists to do id oldID then
				set newID to id of to do id oldID
				if newID is not equal to oldID then
					tell application "Hook"
						set oldBookmark to bookmark id addr
						set hookedBookmarks to hooked bookmarks of oldBookmark
						repeat with hookedBookmark in hookedBookmarks
							unhook hookedBookmark and oldBookmark
							set newName to name of oldBookmark
							set newAddress to "things:///show?id=" & newID
							set newBookmark to make bookmark with properties {name:newName, address:newAddress}
							hook hookedBookmark and newBookmark
						end repeat
					end tell
				end if
			end if
		end tell
	end repeat
end tell
1 Like

This is awesome!

Thank You very much for the update and kudos to the great work!!

Thank You!

1 Like

So this must suggest that Hook’s 2.0 release is imminent, then, right? :grin:

well, I always hesitate to provide an ETA because development is unpredictable; but I’d be extremely surprised if we did not release it before the end of the month. we’re in the very final stages (I may say a few retrospective words after the release.) . And we also have been working on related fronts.