have you considered using Services for this? Services already support taking selected text and doing transformations on it, and allow user-configurable keyboard shortcuts. Plus it will work in any app, not just Notes.
That feature is so well hidden I kind of forgot it exist. I'll check out the selection/transformation stuff!
It is well hidden. It’s also amazing. Services are available system-wide, work in any application and can be as sophisticated as you want, if only because you can put as many shell scripts as you’d like in them and then Bob’s your uncle. It’s one of the key features I miss when I use Linux.
Yeah, Apple services are one of a bunch of semi-forgotten features of macOS that are real gems
Echoing this. Services and other types of macOS system plugins (e.g. color palette plugins) are great with how they enable app-agnostic functionality but are unfortunately underused.