Hook integration scripts v. 101 adds support for DEVONthink 3

In the past, Hook’s support for DEVONthink app was not provided directly in Hook or its integration scripts. Before DEVONthink 3 was officially released, we published help pages listing such scripts. This enabled Pro users to choose the type of integration with DEVONthink they wanted.

We’ve now released version 101 of Hook’s integration scripts, which adds support for DEVONthink 3 — without user customization being required. This compatibility is, of course, available to both Hook Pro and Essentials users.

How it works

When you invoke Hook on an item that is selected or open in DEVONthink 3, Hook will use the item’s x-devonthink-item URL rather than a hook://file URL. This makes sense because DEVONthink stores its items in a database; and DEVONthink does some fancy work to synchronize files across macOS and iOS devices.

So, keep in mind that if you open a DEVONthink 3 item in an app that is external to DEVONthink (such as TextEdit or Preview), and then invoke Hook’s contextual window, the links you get and see (in the Hook contextual window) will be different from what you see when you invoke Hook’s contextual window in DEVONthink itself.

Hook’s integration internally with DEVONthink is pretty much what one would expect. You can use all of Hook’s relevant functions with it. Still, given that Hook is highly customizable, Pro users can tailor Hook’s integration with DEVONthink to their hearts’ content, potentially referring to prior Hook-DEVONthink integration script examples.

For more information, please see Using Hook with DEVONthink by DEVONtechnologies – Hook.

Formatting changes

Version 101 of the integration scripts includes some more formatting improvements to Hook scripts, so that Pro users can more readily understand and customize Hook integration. In particular, the following are prettier (but behave the same) :

  • nvALT
  • Spotify
  • Skim
  • Things
  • Microsoft Word

Getting the update

As always, Hook’s software update / check automatically tries to install the latest integration scripts. You don’t need to download a new version of the app or relaunch it to get integration updates.

1 Like

Regarding DEVONthink 3:

For completeness, users should be aware that new DEVONthink items created via Hook are stored in the destination configured in DEVONthink > Preferences > Import > Destination. This is obvious to frequent users of DEVONthink but perhaps not to casual readers.

You need to unencode the display so that spaces are not encoded when the file name in the DEVONthink database is displayed:

within DEVONthink the file ```Sample Table.tbx" is displayed unencoded, which is correct.

Also, you should not create a new note with the wrong extension. In this case, the new note that Hook created in DEVONthink should be a .txt file not a .tbx file. Behind the scenes (in the file system) you have caused DEVONthink to store a file named ```Sample Table.tbx.txt", which also will create problems for users downstream. Fix the script to strip the extension from the name before storing the next text file in DEVONthink.

Finally, in the Hook contextual menu for the file created in a DEVONthink database, it is critical to get rid of the Reveal File in Finder action. First, it is dangerous to point users to a destination inside a DEVONthink database – there’s no reason for casual users to muck around inside the database structure. Second, the command fails and Hook crashes – which is a good thing as it turns out.**

(FWIW, It is a good idea to test these scripts before publishing them automatically to customers.)

**Yes, I know DEVONthink itself provides the command – should be hidden there too :slight_smile:

DEVONthink provides the same option in its contextual menu as well. Right click on an item in the DEVONthink database, select “Show in Finder” and it will open a Finder window pointing at a file somewhere in the DEVONthink managed file data structure. I always thought that was an odd option (for the reasons you outlined), but if is there and thus a reasonable choice by the Hook team to provide the same functionality?

yikes! this is actually related to something in Hook itself which is fixed in internal versions of Hook; apparently the ‘link to new’ tests /usage were/was done with the internal version, and released version with files without spaces. So a fix will come in the next version rather than the integration scripts.

We’ve updated the DEVONthink integration documentation to make it clear that Link to New from Hook to DEVONthink creates a .txt file in DEVONthink. Pro users can change the default with the script.

It would make sense eventually to provide UI elements or advance preferences for configuring the type of object created by Link to New when that function targets a personal information manager (such as DEVONthink or EagleFiler), where the preference is related to the Notes tab templates setting.

1 Like

No.

Why DEVONthink’s designers decided to add that feature to their menus while at the same time shouting at users not to use it, is a decision known only to them. Of course, for indexed files the commands is useful.

If Hook doesn’t disable the command for DEVONthink documents that’s their call.

1 Like

thanks, @quorm. I’ve added a caution about Reveal File in Finder to the documentation page on Using Hook with DEVONthink by DEVONtechnologies – Hook.

Rather than disable the command, it might be better (optionally) to provide a warning, but we couldn’t do either soon. I’ve made a note of it.

Hook version 1.4, released yesterday, addresses the issues with the names of links to items in DEVONthink 3. Also fixes the Reveal File in Finder in DT crash.

1 Like

I have found myself often needing to copy two or three items from the same DEVONthink group as Markdown links this week, and wishing that it were less cumbersome to do that from Hook.

I understand that a Hook mechanism for multiple selections is planned at some point. In the meanwhile, I found myself assembling a Keyboard Maestro macro:

1 Like