Secure notes in macos keychain are actually hex dumped generic passwords, with plist
as password value.
This plist contains data
node, which is base64 encoded rich text, but also a string
node, which is just plain text.
So fetching secure note plain text via command line (yq required)
get_secret_note() {
security find-generic-password -C note -s "$1" -w | xxd -revert -plain | yq --input-format xml --prettyPrint '.plist.dict.string'
}