Hook integration scripts v. 138 now available — Support for Apple Notes is back!

Version 138 of Hook integration’s scripts is now available with renewed support for Apple Notes in macOS 10.14 (Mojave) and macOS 11 (Big Sur), and partial support for macOS 10.15 (Mojave) Notes.

“Old time” Hook users will recall that macOS 10.15 (Catalina) introduced bugs in its Notes automation that caused CogSci Apps to pull its official support for Apple Notes (though we provided alternative scripts for those who trusted that Apple would fix the bugs.) Well, Apple has fixed those bugs in Big Sur.

Hook now uses the timestamp of a note as an ID for the note. This is based on Artem Chistyakov’s solution, which he published in Github macos-automation/src/notes at master · temochka/macos-automation

Hook’s new integration with Apple Notes introduces a new sub-scheme, hook://notes/dt.

For more information, please see Using Hook with Apple Notes – Hook.

Gratitude

Thanks to Artëm Chistyakov for his solution published in Github macos-automation/src/notes at master · temochka/macos-automation. Artëm’s Twitter handle is Artëm Chistyakov (@artemchistyakov) / Twitter.

Thanks also to Hook productivity forum member, john.catalano for pointing out Artëm’s latest updates.

Hook is a :canada: app that connects great Mac apps from all over the world. We appreciate the contributions of forum members — enthusiasts and developers alike.

Twitter

Also discussed on Twitter

How to get the updated integration

Hook’s automatic software update (if enabled) automatically updates Hook’s integration scripts without you needing to relaunch Hook. Using Hook’s Check for App Updates and Update Scripts command also updates the scripts, without you needing to relaunch Hook.

We also bundle Hook’s integration scripts with the Hook installer itself, of course. But Hook’s app updates are less frequent than the pure integration updates. We will soon release a version of Hook that includes bug fixes and the latest integrations (including with Obsidian, coming next). (Soon after that we will roll out some new features.)

2 Likes

Very very helpful - thank you!

1 Like

When you create a Note from AppleScript, the font size is always smaller than normal “Body” style formatting. I like to add in a bit of HTML formatting for consistency:

set noteName to "$title"
set NoteBody to "<pre style=\"font-family:System Font;font-size:14.5px\">" & noteName
set myNote to (make new note with properties {body:NoteBody})

Note: the 14.5px is my visual approximation. If there is a way to properly set “Body” (or “Title”, etc.) formatting, I am very happy to hear about it.

So, my New Item script, in full, is:

use framework "Foundation"
use scripting additions
property NSDate : a reference to current application's NSDate
property NSNumber : a reference to current application's NSNumber
tell application "Notes"
	activate
	set noteName to "$title"
    set NoteBody to "<pre style=\"font-family:System Font;font-size:14.5px\">" & noteName
	set myNote to (make new note with properties {body:NoteBody})
	set noteCreated to creation date of myNote
	set cocoaDate to NSDate's dateWithTimeInterval:0 sinceDate:noteCreated
	set doubleNoteTimestamp to cocoaDate's timeIntervalSince1970
	set intNoteTimestamp to intValue of (NSNumber's numberWithDouble:doubleNoteTimestamp)
	set stringNoteTimestamp to stringValue of (NSNumber's numberWithInt:intNoteTimestamp)
	set uriRow to "notes://dt/" & stringNoteTimestamp 
end tell

Interesting observation - it is possible to take copy a Hook link to a note and then paste that link into a different note - it works well so that one Apple Note can reference another

This may be particularly helpful once the planned iOS version of Hook is released iOS Version in the future? assuming the links work across platforms as planned.

Any update on the iOS project?