No linkable item found in Apple Notes (under macOS 10.15 Catalina)

When invoking Hook while using Apple Notes I am getting the Hook window which says, “No linkable item found in Notes”.

Is this a new bug or has Hook never worked with Apple Notes? Please note that I just upgrade to Catalina.

Thanks,
Jason

Hook does seem able to derive links here (from Notes.app selections) on 10.14.6 Mojave

I wonder if you have Accessibility checked for Hook.app in

Sys Prefs > Security & Privacy > Privacy > Accessibility

(or the equivalent System Preferences path if that has changed in Catalina)

(I think Notes may be one of the apps for which ‘Assistive Access’ is required to get at the UUID of a selected object)

There is something going on with Apple Notes in 10.15, but this fell through the cracks of my issue report management here. I will update the forum asap.

Thanks Luc, looking forward to your update!

Maybe, but giving the permission in Catalina does not prevent the failure.

If I run the Hook > Notes > Get Address script in Script debugger (under 10.15) this line fails

set noteID to id of note windowName

with

I also saw a call to fetch an id fail in Bookends this morning (tho I’m not running Catalina).

In the case of Bookends, it proved possible to fetch all properties, and then extract the id from the property record.

Does the snippet below return an id string on Catalina ?

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "Notes"
    set strWindowName to name of front window
    set oNote to note (strWindowName)
    set recProps to properties of oNote
    return id of recProps
end tell

( I’m wondering whether the new fencing of CoreData has had some unnoticed side-effect )

i.e. an experimental candidate for an update to the Get Address script for Notes might be:

tell application "Notes"
    activate
    set strWinName to name of front window
    if 2 > (count of windows) or "Notes" = strWinName then
        tell application "System Events"
            tell process "Notes"
                click menu item "Float Selected Note" of menu "Window" of menu bar 1
            end tell
        end tell
        delay 0.05
        set strNoteWin to name of (front window)
    else
        set strNoteWin to strWinName
    end if
    
    -- id value from properties record, 
    -- rather than directly from note object.
    
    -- Works on Mojave. 
    -- Not tested on Catalina, but possibly worth trying.
    
    "notes://" & (text 14 thru -1 of (id of ((properties of (note strNoteWin)) as record)))
end tell

Script Debugger gets upset by this line

set oNote to note (strWindowName)

Fails on Catalina for the same reason.

I wonder if the scripting dictionary has changed …

Don’t have Catalina here, so hard to experiment …

:thinking:

It looks like

name of front window

is always returned as “Notes” even if a note is open in a separate window – with the note’s name in the window bar – and the main window is closed.

This is interesting and unexpected

That looks like a promising discovery (as well as mildly unsettling evidence of API change), can you find a way of getting that id as a string ?

Just to let you all know that we are tuned into this and doing various tests on our side.

1 Like

Fortunately code can branch on version

tell application "Notes"
    version
end tell

In version 4.6 here on Mojave, we don’t have a selection method on the Notes app, so its appearance on Catalina does look promising …

it seems to me that our Catalina Notes testing involved notes not stored in iCloud [and “Copy as Link” and “Link to Copied Address” were working there] but that the issues here have to do with iCloud notes, which is obviously more representative and should have been the test. But we’ll say more about that later.

Possibly, though the scripting interface for Notes has clearly changed in Catalina.

If you hit a compilation problem writing code that targets both Notes versions (Mojave 4, and what I guess might be Catalina 5) then one approach might be to include the sensitive part as a literal string, and invoke it with Applescript’s run script, or the eval in JS, on either side of a branch on version.

We have uploaded a fix for this to the Hook Integration Server (scripts v80). If you experienced a problem before the fix, please let us know if it works for you.

More details to follow.

apparently I spoke before the developers had finalized their changes, sorry.

As I alluded to in response to Rob this morning re Hook integration scripts v. 82: Update to Xcode scripts (for Xcode 11 compatibility) - Releases - Hook Productivity Forum, there is a number of issues with Apple Notes that our investigation has surfaced which pose linking problems. We’ve logged at least one bug with Apple (I think Graham has logged more, I will check with him; there is more than one Apple Notes issue). There is one more set of things I will test today, and then I will provide a summative update here later today (Pacific Time).