Skip to content

Add JXA-based AppleScript reader for faster read operations#3

Open
spiralian wants to merge 1 commit intorossshannon:mainfrom
spiralian:feature/applescript-reader
Open

Add JXA-based AppleScript reader for faster read operations#3
spiralian wants to merge 1 commit intorossshannon:mainfrom
spiralian:feature/applescript-reader

Conversation

@spiralian
Copy link
Copy Markdown

@spiralian spiralian commented Mar 5, 2026

Summary

Replaces slower osascript AppleScript calls with a JXA (JavaScript for Automation) based reader for all read operations, significantly improving performance and fixing incorrect results.

Problem

The original AppleScript bridge uses the things.py library which queries the Things 3 SQLite database directly. This approach returns incorrect todos — the database contains stale/cached data that doesn't always match what Things 3 actually shows. Items can appear in wrong lists, completed items show as incomplete, and recently moved items appear in their old locations.

Solution

The JXA reader talks to Things 3 directly through its scripting interface (JavaScript for Automation), which always returns the correct, current state of todos — exactly what the user sees in the app.

Changes

  • applescript_reader.py (new) — JXA-based reader for all Things 3 read operations
  • fast_server.py — refactored to use new reader for list views and searches
  • formatters.py — improved with project/area title resolution from IDs
  • applescript_bridge.py — cleaned up (write operations remain unchanged)
  • test_e2e_applescript_reader.py (new) — e2e tests for the reader
  • docs/applescript-migration.md (new) — migration documentation

Benefits

  • Correct data — reads from Things 3 directly, not a stale SQLite cache
  • Faster — bulk JXA queries instead of multiple sequential osascript calls
  • More reliable — no dependency on undocumented database schema

- Add applescript_reader.py using JXA (JavaScript for Automation) for all
  read operations, replacing slower osascript calls that returned incorrect data
- Refactor fast_server.py to use new reader for list views and searches
- Improve formatters.py with project/area title resolution
- Clean up applescript_bridge.py (write operations unchanged)
@spiralian spiralian force-pushed the feature/applescript-reader branch from 1506af8 to 9bdcd03 Compare March 5, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant