一键导入
osascript-data
// Read macOS app SQLite databases directly. Use when reading iMessage chat history, Chrome browsing history, Safari history, or any local app SQLite DB. Always copy the DB before querying — most apps lock the file while running.
// Read macOS app SQLite databases directly. Use when reading iMessage chat history, Chrome browsing history, Safari history, or any local app SQLite DB. Always copy the DB before querying — most apps lock the file while running.
Script macOS apps via AppleScript/JXA: Mail, Calendar (EventKit attendees), Notes, Reminders, Finder (disk/file info), and Spotlight/mdfind (full-text and metadata search across the file system).
Control macOS system audio via osascript. Use when getting or setting system volume, toggling mute, listing audio input/output devices, or checking which device is the default output.
Automate Google Chrome with osascript/JXA. Use when listing/focusing/closing/navigating/reloading tabs, muting tabs, managing windows, executing JavaScript, scraping page content, extracting links, filling forms, reading localStorage/cookies/audio state, or reading Chrome history/bookmarks/downloads/extensions/profiles.
Read and write the macOS clipboard with full type support. Use when reading clipboard text, HTML, RTF, images, or file paths (Finder copy); writing rich content; detecting clipboard changes via changeCount; or intercepting content between copy and paste.
Create and manage macOS LaunchAgents and LaunchDaemons. Use when setting up background automation, scheduled tasks, file watchers (WatchPaths), interval polling, or persistent daemons that survive logout or reboot.
Inspect macOS network state. Use when getting current WiFi SSID, signal strength, and channel; listing all network interfaces with IP/MAC addresses; or watching for network connect/disconnect events via Darwin notifications.
| name | osascript-data |
| description | Read macOS app SQLite databases directly. Use when reading iMessage chat history, Chrome browsing history, Safari history, or any local app SQLite DB. Always copy the DB before querying — most apps lock the file while running. |
Direct SQLite access to macOS app databases. No API, no auth — plain file reads.
All scripts are pure Python using stdlib only (sqlite3, shutil).
Always copy before querying. Most apps (Chrome, Messages) lock their DB while running.
shutil.copy2(db_path, "/tmp/copy.db")
conn = sqlite3.connect("/tmp/copy.db")
| App | Path | Permission needed |
|---|---|---|
| iMessage + SMS | ~/Library/Messages/chat.db | Full Disk Access |
| Chrome History | ~/Library/Application Support/Google/Chrome/Default/History | Full Disk Access |
| Safari History | ~/Library/Safari/History.db | Full Disk Access |
| TCC permissions | ~/Library/Application Support/com.apple.TCC/TCC.db | Full Disk Access |
Run a raw SQL query against any DB (copy-first):
uv run scripts/sqlite-query.py ~/Library/Messages/chat.db "SELECT * FROM message LIMIT 10"
Read recent iMessages with sender, timestamp, and direction:
uv run scripts/imessage-read.py
uv run scripts/imessage-read.py 50
uv run scripts/imessage-read.py 20 "John"
Read Chrome browsing history (Windows epoch → UTC):
uv run scripts/chrome-history.py
uv run scripts/chrome-history.py 50 github
Read Safari browsing history (CoreData epoch → UTC):
uv run scripts/safari-history.py
uv run scripts/safari-history.py 50 github
Audit TCC.db — see all app privacy permission grants:
uv run scripts/permissions-audit.py
uv run scripts/permissions-audit.py --service kTCCServiceCamera
uv run scripts/permissions-audit.py --allowed
chat.db (SQLite) → read new message → Python/Claude reasons → osascript → Messages app → sends reply
See reference/06-sqlite.md for the full pattern with WatchPaths trigger.