I am receiving an error when I attempt to Hook to New (Notes.app) Note.
The script below successfully creates a new note, on its own. I’ve pasted the below script into the Scripts > Notes > New Item section
set NoteBody to "<pre style=\"font-family:System Font;font-size:14px;\">"
tell application "Notes"
tell account "iCloud"
make new note at folder "Notes" with properties {body:NoteBody}
end tell
end tell
When I select a file and attempt to Hook to a New…, I select Notes.app, but then receive an error message:
Is this the fault of my New Item script? If so, what parameters am I missing?
tell application "Notes"
activate
set noteID to «class seld» of ((make new note with properties {name:"$title"}) as record)
set noteID to text 14 thru -1 of noteID -- "x-coredate://noteID"
get "notes://" & noteID
end tell
Thank you. FYI - if you want the fonts to be consistent with body text, you need to add the HTML. This is working for me:
tell application "Notes"
activate
set noteID to «class seld» of ((make new note with properties {body:"<pre style=\"font-family:System Font;font-size:14px;\">" & "$title" & "</pre>"}) as record)
set noteID to text 14 thru -1 of noteID -- "x-coredate://noteID"
get "notes://" & noteID
end tell