Hey Steffen,
I don’t think you can convert between an NSRange and an AXTextMarker. Everything VoiceOver does to navigate through WebKit text is done with AXTextMarkers and the parameterized attributes.
I will admit that parameterized attributes like AXNextWordEndTextMarkerForTextMarker are fairly limiting unless you’re building a screen reader...
Josh
On Apr 30, 2014, at 11:30 PM, Steffen Öding Andersen < email@hidden> wrote: Hi Josh
Thank you that help and I can now get the selected text.
As a follow up question, now with the possibility to get the selected range with AXSelectedTextMarkerRange, is there a way to convert the range to a NSRange and since it should be settable how would you take a NSRange and convert it to a AXTextMarker?
I can’t seem to find the documentation, other than header files, about the use of AX-api?
Once again any help is appreciated.
Best regards Steffen
On 30 Apr 2014, at 01:06, Josh Scotland < email@hidden> wrote: Hello Steffen,
Mail uses a WebKit view to display emails. You’ll have to do everything via AXTextMarker and AXTextMarkerRange objects, instead of using an index like you would in TextEdit. With AXSelectedTextMarkerRange, you can pull out the string with the parameterized attribute AXStringForTextMarkerRange.
Josh On Apr 29, 2014, at 5:30 AM, Steffen Öding Andersen < email@hidden> wrote:
Hi I’m trying to get the selected text from a mail and
highlight it, with the use of the AX-API. It’s possible to get the text with the use of kAXValueAttribute
on the AXUIElementRef and even getting the size of the box
containing the text, with the use of kAXSizeAttribute. I’m guessing I should use
something like AXSelectedTextMarkerRange to get the text and set the highlight.
However, the AXSelectedTextMarkerRange (this is the same for AXStartTextMarker
and AXEndTextMarker) does not seem to return a correct value, compared to doing
the same in e.g. TextEdit. Apples Voice over can read selected text from mail, so
unless it access to some private methods, I guess it should be possible to do
the same? Any help is appreciated.
Best regards
Steffen Andersen
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|