Hypothes.is bookmarklet to annotate DT3 bookmarks

I have started to use Hypothes.is to annotate webpages and pdfs.
Would it be possible to add its javascript bookmarklet to a DT3 bookmark as a script?

No you can’t add it as a bookmarklet to DEVONthink.

The AppleScript command do JavaScript could be used instead. But it doesn’t accept bookmarklets (URLs containing JavaScript).

Christian, Jim,

Are you suggesting that instead of adding a bookmarklet, one can wrap the bookmarklet JS within a script? If so, may I recommend a “factory” script that would automate the process, accepting a bookmarklet as input and returning the script code? Or am I overcomplicating it?

I don’t know what a “factory script” is nor do I have an account with this service to test. However, you could add an AppleScript to run in the current window when viewing a web page.

tell application id "DNtp"
	do JavaScript "(function(){window.hypothesisConfig=function(){return{showHighlights:true,appType:'bookmarklet'};};var d=document,s=d.createElement('script');s.setAttribute('src','https://hypothes.is/embed.js');d.body.appendChild(s)})();" in think window 1
end tell

Note this will have no effect when you’re looking at non-web data but this is not error-trapped in any way.

1 Like

Oops, I meant “script factory” but the solution is too simple, apparently, to warrant one. Thanks, Jim.

You’re welcome :slight_smile: