Monitors MacOS Messages app for incoming messages with 2FA codes, copy them to clipboard and mark them as read.
Use 2fa_monitor.py and com.2fa.monitor.plist when creating the new files:
touch /Applications/2fa_monitor.py
touch ~/Library/LaunchAgents/com.2fa.monitor.plist
launchctl load ~/Library/LaunchAgents/com.2fa.monitor.plistGrant full disk access in order to allow the script to read messages DB:
- Open System Settings
- Go to Privacy & Security β Full Disk Access
- Click the lock and authenticate
- Add your Terminal/Python app:
- Toggle it ON
- IMPORTANT: Completely quit and restart your Terminal
- Run this script again
