Add JXA-based AppleScript reader for faster read operations#3
Open
spiralian wants to merge 1 commit intorossshannon:mainfrom
Open
Add JXA-based AppleScript reader for faster read operations#3spiralian wants to merge 1 commit intorossshannon:mainfrom
spiralian wants to merge 1 commit intorossshannon:mainfrom
Conversation
- 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)
1506af8 to
9bdcd03
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces slower
osascriptAppleScript 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.pylibrary 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 operationsfast_server.py— refactored to use new reader for list views and searchesformatters.py— improved with project/area title resolution from IDsapplescript_bridge.py— cleaned up (write operations remain unchanged)test_e2e_applescript_reader.py(new) — e2e tests for the readerdocs/applescript-migration.md(new) — migration documentationBenefits
osascriptcalls