I just posted this on MacScripter.
I have Notes in the 3-pane Folders → Note-List → Note configuration.
When working on this I noticed I had some duplicate note titles, so I'm filtering by mod-date as well as name.
If anyone knows how to do this better I'm all ears.
-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/11/11 12:45
# dMod: 2015/11/11 13:07
# Appl: Notes.app & System Events
# Task: Acquire selected note for processing.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Notes, @System_Events, @Acquire, @Selected, @Note
-------------------------------------------------------------------------------------------
tell application "System Events"
tell application process "Notes"
tell (first window whose subrole is "AXStandardWindow")
tell table 1 of scroll area 1 of group 1 of splitter group 1 of splitter group 1
set selectedNotes to rows whose selected is true
set theRow to item 1 of selectedNotes
set noteTitle to value of static text 1 of UI element 1 of theRow
set noteModDate to value of static text 3 of UI element 1 of theRow
end tell
end tell
end tell
end tell
tell application "Notes"
set noteList to notes whose name is noteTitle
if length of noteList = 1 then
set theNote to item 1 of noteList
else if length of noteList > 1 then
repeat with i in noteList
tell (get modification date of i) to set modDateStr to its short date string & " " & its time string
if modDateStr contains noteModDate then
set theNote to contents of i
end if
end repeat
end if
set noteProps to properties of theNote
end tell
-------------------------------------------------------------------------------------------