Re: When is NSAccessibilityRTFForRangeParameterizedAttribute used?
Re: When is NSAccessibilityRTFForRangeParameterizedAttribute used?
- Subject: Re: When is NSAccessibilityRTFForRangeParameterizedAttribute used?
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 9 Apr 2010 20:12:35 -0400
On Apr 9, 2010, at 6:20 PM, Scott Kovatch wrote:
> On Apr 9, 2010, at 3:07 PM, Bill Cheeseman wrote:
>
>> You might find it helpful to use PreFab UI Browser in your testing. This and the other parameterized text attributes are handled. For this attribute, you can set the range parameter in UI Browser and get back the corresponding RTF from any RTF view.
>>
>> For example, type some RTF text into a TextEdit window. Then, with UI Browser running, place the cursor over a line of text and hit the system-wide hot key (Control-Command-S). The text view will automatically be selected in UI Browser's main browser window. Then open UI Browser's Attributes drawer and select the RTF for Range attribute. Some UI elements will appear to the right in the drawer allowing you to set different input ranges and extract the associated text. To see the extracted text in all its RTF glory, click the View in Window button.
>
> Thanks -- I have UIBrowser already, and do find it very useful, but I didn't realize it could call into another app and make those requests!
>
> Am I supposed to be able to see the raw RTF or does UIBrowser just re-display the text with all of the applied RTF annotations?
UI Browser just re-displays the text. In the Value column of the Attributes drawer, it displays the string without applying the RTF annotations. When you click the View in Window button, you see the text with the RTF attributes applied (bold, italic, whatever).
The engine underlying UI Browser is my PFAssistive framework, an Objective-C framework wrapping the C accessibility API (and in some respects enhancing it). I am finishing up its documentation now, and I will make the framework available for licensing when I release the next version of UI Browser later this month. (The framework will be free for noncommercial use.) You might watch for it, because it may contain some material that is useful to you. I haven't worked on the RTF part of it for a while, but as I recall I include a method that returns the RTF data in an NSData object, which you should be able to deconstuct.
My framework does handle the special accessibility attributed string constants that James Dempsey refers to in his reply. It even includes methods that convert accessibility attributed strings to Cocoa attributed strings, and vice versa.
Yes, UI Browser calls into other apps. That's what the accessibility API is about, after all. UI Browser can set accessibility attributes in other apps' UI elements, perform accessibility actions on other apps' UI elements, send accessibility keystrokes to other apps, and register to receive accessibility notifications from other apps. Plus, it generates AppleScript statements that can do the same things using Apple's accessibility-based GUI Scripting technology. UI Browser is a fully implemented assistive application in its own right, like VoiceOver but aimed at developers instead of users.
--
Bill Cheeseman
email@hidden
_______________________________________________
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