notifwd icon indicating copy to clipboard operation
notifwd copied to clipboard

Doesn't work on MacOS Sequoia 15.3.2

Open jbek7 opened this issue 11 months ago • 2 comments

When I run /Users/User1/Documents/notifwd/notifwd.py --api-key <mykey> -s -f 40, I get below error:

  File "/Users/User1/Documents/notifwd/notifwd2.py", line 207, in <module>
    Notification.main(argv)
    ~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/User1/Documents/notifwd/notifwd2.py", line 84, in main
    Notification.setup(argv)
    ~~~~~~~~~~~~~~~~~~^^^^^^
  File "/Users/User1/Documents/notifwd/notifwd2.py", line 73, in setup
    last_data = Notification.get_notification_data(0)
  File "/Users/User1/Documents/notifwd/notifwd2.py", line 124, in get_notification_data
    return Notification.cursor.execute("SELECT * FROM (SELECT * FROM record ORDER BY rec_id DESC LIMIT %d) ORDER BY rec_id LIMIT 1" % (n + 1)).fetchone()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.OperationalError: no such table: record

It was working before the OS upgrade.

Maybe relevant: https://9to5mac.com/2024/09/01/security-bite-apple-addresses-privacy-concerns-around-notification-center-database-in-macos-sequoia/

jbek7 avatar May 14 '25 21:05 jbek7

I changed the DB path to:

        db_path = Path.home() / "Library/Group Containers/group.com.apple.usernoted/db2/db"

        Notification.connection = sqlite3.connect(db_path)
        Notification.cursor = Notification.connection.cursor()

it works fine now and you'll also need to grant full disk access for the terminal/iterm from OSX Security & privacy settings.

jbek7 avatar May 14 '25 23:05 jbek7

Just wanted to chime in to whoever finds this next who might not be able to connect the dots, this fix worked for me but required that I import the pathlib package at the top of the file like so: from pathlib import Path

CraftyCanine avatar Oct 02 '25 00:10 CraftyCanine