phillco / talon-axkit

Talon macOS accessibility magic!
MIT License
45 stars 12 forks source link

dictation: consider not grabbing the entire AXValue #8

Closed nriley closed 3 months ago

nriley commented 2 years ago

At least in some cases you can explicitly request a range, e.g.:

>>> o.focused_element.children.find_one(AXRole='AXTextArea').AXStringForRange[Span(0, 10)]
'\n\nNicholas'

This may be more efficient with long documents.

phillco commented 2 years ago

Nice, didn't know about AXStringForRange. Since we need DEFAULT_CONTEXT_CHARACTERS characters in both directions this should be a nice performance bump

nriley commented 3 months ago

After several years of using accessibility dictation in its current form, I don't really think this would help much — document sizes are so small and retrieving their text never seems like a performance issue in reality, when compared with the delay necessary to perform speech recognition. Closing.