I keep my libraries of function definitions in Quiver, which seems to Hook well once an entry for Quiver is created in Hook Preferences using the following scripts (which differ only in respect of the data type which they extract from the clipboard):
Get Name
tell application "Quiver" to activate
set the clipboard to ""
tell application "System Events"
tell process "Quiver"
tell menu item "Copy Note Link" of menu "Note" of menu bar 1
repeat with i from 1 to 3
click it
end repeat
end tell
end tell
delay 0.05
end tell
the clipboard as string
Get Address
tell application "Quiver" to activate
set the clipboard to ""
tell application "System Events"
tell process "Quiver"
tell menu item "Copy Note Link" of menu "Note" of menu bar 1
repeat with i from 1 to 3
click it
end repeat
end tell
end tell
delay 0.05
end tell
Ā«class utf8Ā» of (the clipboard as record)
Selected once but clicked 3 times ā very occasionally, depending on system load etc, a scripted click can get dropped, so this is just a bit of ābelt and bracesā redundancy.
(You would probably find that it worked perfectly well with just one click)
Also, I suspect itās not dropping the clicks but rather not updating the clipboard fast enough. In other Hook scripts Iāve had to loop a delay until the target app has updated the clipboard as theyāre run in parallel.
Eg. (Pseudo code as Iām on mobile)
tell process "Quiver"
click menu item "Copy Note Link" of menu "Note" of menu bar 1
end tell
repeat with i from 1 to 3
if clipboard != āā then break
delay 0.5
end repeat
Could well be. Sometimes, in UI scripting the click event request does come before the menu item reference is fully resolved, but in any case I agree that something like:
repeat until (intMax < clickCount) or ("" ā clipboard)
Thank you all ! Quiver support is now in the latest script bundle (version 61) on Hookās integration server ā available via Hookās in app update mechanism.
Probably linked to the issue I faced. I got the Quiver update (and a whole bunch of other scripts as well) when I reinstalled Hook. The updates panel displayed scripts bundle version as 61 in both cases)