2 Replies
      Latest reply on Aug 19, 2019 8:22 AM by iQser_Developer
      iQser_Developer Level 1 Level 1 (0 points)

        I would lime to read the content of a selected note with AppleScript. Here is the simplified script:


        using terms fromapplication "Notes"
          tell application "Notes"
          log selection
          log (count of selection)
          log item 1 of selection
          set theNote to item 1 of selection
          log name of theNote
          end tell
        endusing terms from


        Unfortunately I get the error message. Here is the log output:


        (*item 1 of selection*)
        error "Notes got an error: Can’t make item 1 of selection into type specifier." number - 1700 from item 1 of selection to specifier

        Has someone an idea?

        • Re: How to resolve an AppleScript error 1700?
          eskimo Apple Staff Apple Staff (12,075 points)

          I don’t think Notes provides a good way to get the selection.  If you open its scripting dictionary in Script Editor and search for select, there’s no results.

          Oh wait, you’re on 10.15 beta!  That does have a selection property, but the app’s scripting seems to be having general problems.  For example, a simple script like this:

          tell application "Notes"
              note 1
          end tell

          works on 10.14.6 but fails on 10.15 beta.  And if you force the issue with this code:

          tell application "Notes"
              note 1 of default folder of default account
          end tell

          you get back a show object, not a note object.  Weird.

          I encourage you to file a bug about any such misbehaviour you see.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"