Skip to content

Improving search speed #54

Answered by RhetTbull
changyang1230 asked this question in Q&A
Discussion options

You must be logged in to vote

macnotesapp relies on the AppleScript interface to interact with Notes and this is very slow (and in some cases buggy which macnotesapp jhas to work around). Your code requires searching through every single note which means that each note has to be retrieved via the very slow AppleScript interface. As you noted in the second post, the solution is to use noteslist() which does the search in Notes before returning the AppleScript objects. This for example, returns the IDs of all notes whose text (body or name) matches "keyword"). This is much faster though it's still not as fast as I'd like. The NotesList properties return a list of all matching notes.

>>> import macnotesapp
>>> results =

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RhetTbull
Comment options

Answer selected by changyang1230
@changyang1230
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants