Using Keyboard Maestro to create links between files in annotations

This Keyboard Maestro macro was inspired by Hook, an excellent productivity program. I love the idea of having links between related files. However, in Hook, there is no way by just looking at the file (Finder / Devonthink, etc), if it has links to another file without opening the Hook window.

This macro adds a 2-way link between two files in Devonthink. The macro creates RTF annotations, and appends the links to the bottom. If a file already has an annotation, then the new link just gets added to the bottom.
In this example, I linked a file (…Real Grape Soda Recipes) to two other files (…Ginger bug Recipe & …Homemade Ginger Ale).

By looking for the annotation icon, you can see if there are links (In the future, I hope the DTTG supports showing if a file has annotations).

2020-04-01_21-38-07

To run the macro, there are two steps:

  1. Copy the Item Link of the first file (Ctrl-Option-Cmd-C
  2. Click on the second file and trigger the macro

I have recorded a GIF of the macro in operation.

I am sharing the macros I use, if it can inspire someone. I am not a programmer, and I am sure there are more elegant ways to do this (AppleScript ???). Another thing - It would probably needed tweaking on another computer as I am using “Found images” in the UI to control the mouse, and depending on your monitor, the number of pixels the mouse moves would change.

Here are the two macro. Just run the main macro…

Devonthink Macros.kmmacros.zip (27.5 KB)