Hookmark works flawlessly for creating bookmarks to DevonThink files/folders.
However, I have the regular use case where I want to add multiple files/folders at once. Currently, it’s a bit tedious to invoke Hookmark on each one individually and then create the bookmark.
Is there a way to script this, such that I could select the files/folders in question and then hit a hotkey to create a bookmark for each of them? As for the hotkey part I could assign this via keyboard maestro, but I would highly appreciate advice on how to write such a script.
tell application id "DNtp"
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
end repeat
end if
end tell