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