RhetTbull / macnotesapp

Work with Apple MacOS Notes.app from the command line. Also includes python interface for scripting Notes.app from your own python code.
MIT License
141 stars 6 forks source link

Not able to detect notes #24

Closed josca42 closed 1 year ago

josca42 commented 1 year ago

I installed macnotesapp using pip install.

When trying to use macnotesap it seems that it can't detect my notes

running notes list and notes accounts just return an empty list

and if I try to add notes using f.ex. notes add < test.txt

Then I get the following error:

File "/Users/josca/mambaforge/envs/pa/lib/python3.10/site-packages/macnotesapp/notesapp.py", line 190, in account raise ValueError(f"Could not find account {account}") ValueError: Could not find account None

Do I need to specify some missing environment variables? Or did I install it the wrong way?. I'm using a macbook m1 with ventura 13.3.1

RhetTbull commented 1 year ago

Hi. It sounds to me that it's likely a permissions issue. macnotesapp needs to automate Notes using ScriptingBridge and AppleScript and this requires the user to grant permission. When you first ran notes list, your terminal app (I'm assuming Terminal.app) should have prompted you for permission to access Notes (screenshot below). Take a look in your System Settings > Privacy & Security > Automation and see if your Terminal app lists Notes (see screenshot).

Screenshot 2023-04-15 at 7 35 48 AM Screenshot 2023-04-15 at 7 36 36 AM
josca42 commented 1 year ago

Thanks so much for the fast reply. You were exactly right. Should have spotted that.

And thanks so much for this library. It really fills and empty spot. Couldn't find any good libraries for working with apple notes before discovering macnotesapp. Really appreciate you open sourcing this!.