Hi there, this script creates a bookmark for the current Safari tab in DEVONthink 3 and adds this to the reading list.
If you use another browser or want to add other kinds of records I recommend using this script together with a shortcut for the DEVONthink 3 menu which adds to the reading list (you can set custom shortcuts in System Preferences). Run the script, hit your shortcut and you’re done.
-- Add bookmark for current Safari tab and add this new record to DEVONthink 3 reading list
property GroupUUID : "" -- set UUID of the group where bookmarks should live
tell application "Safari"
tell window 1
tell current tab
set theURL to URL
set theName to name
end tell
end tell
end tell
tell application id "DNtp"
try
set theGroup to (get record with uuid GroupUUID)
set theBookmark to create record with {type:bookmark, URL:theURL, name:theName} in theGroup
add reading list record theBookmark
display notification theName with title "Added to reading list"
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink 3" & space & error_number message error_message as warning
end try
end tell
It does over here?
It placed the tab-contents (as Browser file) in both the location I selected (as prompted when invoking the script), and over in the Reading List.
BTW:
It’s not necessary to create a bookmark too, a slightly revised script could only add an item to the reading list:
-- Add current Safari tab to DEVONthink 3's reading list
tell application "Safari"
tell current tab of window 1
set theURL to URL
set theName to name
end tell
end tell
tell application id "DNtp"
try
add reading list URL theURL title theName
display notification theName with title "Added to reading list"
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
Nice, I didn’t try this in the first place. Much better as there are no bookmarks to delete.
However sometimes I also would like to link to a reading list item outside of DEVONthink 3. Any chance to get a Reference URL for your “virtual” reading list item?
Or perhaps you could add a hidden item in the context menu (like its done with the “delete all instances” one) which deletes the record (not just the entry in the reading list)? This could use an extra safe shortcut like shift + option to avoid any accidents…
There’s always a chance But currently it’s not planned. You could either use boomarks for this scenario or maybe simply insert the destination URL outside of DEVONthink?
Then please consider adding a (hidden) context menu option to delete the record. Currently it’s a bit complicated to remove records that are only temporarily used:
Yes but it doesn’t really help. Maybe it’s an option to make the “Show in database” item open in a new window when shift is pressed? Deleting is not the problem but losing the reading list window is. So it would help if “Go back” would go back to the reading list. It’s losing the reading list that makes it complicated
Beta 3 will include a new contextual menu command to trash the selected item. Emptying the trash afterwards deletes both the item and its reading list entry.