Hook with Obsidian

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

Sounds like this is an asynchronous function - opening a URL. I don’t know how one handles that in Applescript.

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).

1 Like

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.

I believe I was having some trouble with 0.11.13. With 0.12, and 0.12.1 (Insider builds), it’s all but unusable.

The delay before running it seems to help.

Can’t wait for Hook to New > Obsidian though!

1 Like

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.

May I ask your macOS version?

Thank you!

Thanks, @technovangelist. We’ll add the delay in the next update (Hook 3.0), which is in final phases of QA.

I am using MacOS 10.15.7
Hook 2.2.2
Obsidian 0.12.1

Hi Luc:

Tying ends…

We are really looking forward to know more about Hook 3.0! :wink: What day do you plan to release the new version? :pray:

Thank you very much

1 Like

Welcome to the Hook Productivity Forum , @tberni. And thanks for the kind words!

We’re playing it day by day. This week (knock on wood).

Many thanks to you for your advance information. I look forward to this new version.

1 Like