title: Applescript - get note from Notes.app
body: <p>can someone explain this weird behaviour to me? I am trying to get a note named "TEST" but even when I run this command:</p>
  
  <pre><code>tell application "Notes"
      activate
      set theName to get name of the first note
      display dialog theName
      set theNote to the note whose name is theName
  end tell
  </code></pre>
  
  <p>Dialog will correctly display name (that is a "TEST").
  But this code resulted with an error: "Can’t get note whose name = \"TEST\"."</p>
  
  <p>What am I doing wrong?</p>