Quiver note-taking app (HappenApps)

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)
3 Likes

Thanks for sharing.

Why do you select the menu item several times?

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)

The script may run faster if you break from the repeat when clipboard != ā€œā€

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
1 Like

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)

seems a good candidate for covering both cases.

Make sure you put a break in though or youā€™ll create an infinite loop in Hook if something doesnā€™t work.

1 Like

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.

How does one get your Quiver scripts ?

So far Iā€™ve tried:

  • running update,
  • and performing a root and branch uninstall, redownload and reinstall of Hook.app

but no sign yet of Quiver in the scripts list.

Iā€™m probably missing something ?

(Updates panel displays scripts bundle version at 61)

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)

1 Like