# "Usernoted" seems to be the "user notifications daemon", so get it's PID. pid=$(ps aux | grep -i [u]sernoted | awk '{print $2}') # Find the sqlite3 database that this program has open. It's in a "private" folder (app sandboxing). db="$(lsof -p $pid | grep com.apple.notificationcenter/db/db\$ |...