abruneau / apple-notes-jxa

Simple module to read, edit, and manage Apple Notes throught JXA (offline)
https://abruneau.github.io/apple-notes-jxa/
41 stars 4 forks source link

execution error: Error: Error: Can't convert types. (-1700) #1

Open bloatfan opened 3 years ago

bloatfan commented 3 years ago

hi、i use this demo、report error

my os:

catalina: 10.15.4

code

const Notes = require('apple-notes-jxa');

Notes.accounts()
  .then((accounts) => console.log(accounts));

error

image

please help me, thank you!

patniemeyer commented 2 years ago

I'm not sure if this is the cause of the above (the "Can't convert types" just comes up in every context when things go wrong) but I found that if you refer to Application("Notes") now you actually get the widget extension instead of the app. You have to use Application("com.apple.Notes").