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
129 stars 6 forks source link

Error when adding note with notes add -u #26

Closed RhetTbull closed 1 year ago

RhetTbull commented 1 year ago

Ventura 13.1

❯ notes add -u https://suedbroecker.net/2021/01/25/how-to-install-mkdocs-on-mac-and-setup-the-integration-to-github-pages/
Traceback (most recent call last):
  File "/Users/rhet/.local/bin/notes", line 8, in <module>
    sys.exit(cli_main())
             ^^^^^^^^^^
  File "/Users/rhet/.local/pipx/venvs/macnotesapp/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rhet/.local/pipx/venvs/macnotesapp/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/rhet/.local/pipx/venvs/macnotesapp/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rhet/.local/pipx/venvs/macnotesapp/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rhet/.local/pipx/venvs/macnotesapp/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rhet/.local/pipx/venvs/macnotesapp/lib/python3.11/site-packages/macnotesapp/cli/cli.py", line 195, in add_note
    account = notes.account(account_name)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rhet/.local/pipx/venvs/macnotesapp/lib/python3.11/site-packages/macnotesapp/notesapp.py", line 190, in account
    raise ValueError(f"Could not find account {account}")
ValueError: Could not find account ['i', 'C', 'l', 'o', 'u', 'd']
RhetTbull commented 1 year ago

This was an issue when notes config had not been run and the TOML was being created with a list of unicode chars instead of str due to PyObjC unicode string object needing a cast to str