After lots of searching around I can’t quite figure out if the integration between Obsidian and Hook doesn’t work and I am not alone, or it does work just not for me. Every time I would do the keyboard shortcut on Obsidian I would see hook flash and go away. I can see that it gets the right page in the Hook UI, but doesn’t keep it on screen.
I found that I can get it to reliably work by simply adding a delay into the Get Address script after the 3rd line:
set myURL to "obsidian://hook-get-address"
set myScript to "open '" & myURL & "'"
do shell script myScript
delay 0.4
repeat 50 times -- poll clipboard for ~2.5 seconds
try
if (the clipboard) is not equal to "" then
exit repeat
end if
end try
delay 0.01
end repeat
get the clipboard
I am using hook / obsidian with no issues. The hook applet opens and each of the link options are available to me. obsidian version v.0.11.13 and hook Version 1.2.2 (2716).
Thanks for writing in. The good folks at Obsidian will provide a more reliable API for interacting with Hook. This will also fill in the gaps such that we can implement the Hook to New > Obsidian function.
Though I don’t recall hearing of timing issues with Obsidian, whenever a script has hard-coded delays it is possible that timing issues will arise that typically can , as you say, be fixed by adjusting the time parameter.
It never worked for me until I added that delay. there seems to be enough posts about it being broken that I didn’t feel bad about it. Same version of Hook, though I am on 0.12.1 of Obsidian. But it hasn’t worked for a long ttime.