Create bookmarks for a set of many DevonThink folders

Hi,

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.

Thanks in advance.

Thank you for contacting us, @AW2307 .

Here is a script you can give it a try:

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

Thank you

2 Likes

This works flawlessly. Many thanks!! @bchend

1 Like