DEVONthink Linking Files No Function(An AppleScript App has been created to address this issue)

Hello Luc and community,

I am a heavy user of DEVONthink and would like to link files together - therefore I bought Hookmark. I have read alle the manuals, but still it seems not to work:

  1. I select multiple files in DEVONthink and drag them to the Hookmark menu bar icon.
  2. In the Hookmark windows it says “linked x items together”, so far so good.
  3. I have a script (from the forum here) to add a label “Hookmark” to the file in DEVONthink, that label is attached to the files in DEVONthink. This indicates as well that the linking process worked to some extend.
  4. But when I select one of the files in DEVONthink, the Hookmark menu bar icon does not indicate any linked files, and also opening the Hookmark window, it does not show any linked items as well.

Does anyone know how this could be fixed? Meanwhile Hookmark is pretty useless in my workflow.

I am using Hookmark Version 6.2 (6017; Integration v. 330) and
DEVONthink 3.9.6

Thanks in advance!

Thank you for reporting this issue and sorry about this, @Rangerope .

We will look into this issue.

For now, you can link two files in Devonthink by:
(1)Select a Devonthink file, do “Copy Link”
(2)Select another Devonthink file, do “Hook to copied link”

Thank you

Hi @bchend,

link one file to another like you hav described in your workaround does somehow work, but is no replacement for the desired function of linking multiple files together at once.

I am desperatly awaiting your advice/fix.

@forum: Am I the only person with this problem? To all DEVONthink + Hookmark users: does linking multiple files together by drag&drop work on your installations?

This would help finding a solution.

Thank you all.

Hello @bchend

can you already tell us about the outcome of your investigation and possible solutions? Still no success here - problem is still persistent…

Thank you in advance.

Sorry about this issue, @Rangerope .

It will take a while to fix it in Hookkmark’s drag and drop.

I will create an AppleScript app for you to do this mesh linking.

Thank you

Here is the AppleScirpt app: (51.7 KB)

To use this App:
(1)Select multiple records in Devonthink
(2)Run this app. The first time you run it, please right click on the app in Finder, select “Open”. It will ask for permissions to open it. It will aslo ask for permissions to access Devonthink.

Please let us know if there is any problem.

Thank you

The website could have been clearer. It says “To link items from certain apps (like Finder) together, you can drag and drop them onto Hookmark’s menu bar icon. Drag & drop linking only works with certain apps.” But it doesn’t list the apps.

I’ve added the following qualification to the page, Drag and Drop Linking: Many Items at a Time – Hookmark :

Currently, only Finder supports dropping multiple items onto the menu bar icon or menu bar window. You can’t drop multiple items from other apps in the menu bar window.

Only some apps support dropping on menu bar window at all. These include Finder, most web browsers, Apple Mail, AirMail, Mailmate, OmniFocus, and some other apps that are automated with AppleScript.

further documentation updates to follow.

Hi @bchend ,

thank you for your workaround. unfortunately it does not work. I selected some records (all local files, synced and downloaded) but then there is an error message popping up with the (German) text:

«class BkmK» id "x-devonthink-item://A5B8749D-4931-41E9-9595-A91B066DBB3E" of application "Hookmark"“ kann nicht gelesen werden.

When I select to modify the script in the script editor, and run it again, the error message is slightly different:

error "„Hookmark“ hat einen Fehler erhalten: „bookmark id \"x-devonthink-item://8BA4AE89-10AB-4E8E-B51E-01D180C2E3C3\"“ kann nicht gelesen werden." number -1728 from bookmark id "x-devonthink-item://8BA4AE89-10AB-4E8E-B51E-01D180C2E3C3"

Can you figure out what is wrong here?

Thank you so much…

Sorry about this, @Rangerope .

I tried to reproduce the problem on my mac. But no luck yet.

I just modified the script. You can adjust the delay time and see if there is any difference. It could be a cache problem.

Could you please start with by selecting 3 Devonthink items? If the problem persists, restart Hookmark and see if that helps.

tell application id "DNtp"
	set res to {}
	if class of window 1 is equal to viewer window then
		set selected_items to selection of window 1
		repeat with theItem in selected_items
			set theURL to reference URL of theItem
			set theName to name of theItem
			tell application "Hookmark"
				set aRec to make bookmark with properties {address:theURL, name:theName}
			end tell
			set the end of res to aRec
		end repeat
	end if
end tell

display dialog "before mesh linking"

delay 3

tell application "Hookmark"
	repeat with bk1 in res
		repeat with bk2 in res
			hook bk1 and bk2
		end repeat
	end repeat
end tell
display dialog "Mesh linking is finished"

Thank you

Hi @bchend,

now it works miraculously. I got a new Mac and something was wrong with the access permissions. I have uncommented the dialogs and installed the script as a service action. Meanwhile it worked well so far. Thank you very much.


Thank you, @Rangerope . I am glad it works.

Is the line “delay 3” necessary? Or you also commented it out.

I have commented it out. Works for me. If it gets stuck, I may re-insert it…

Thank you!

Thank you for the info, @Rangerope .