Glitches when setting string values
Glitches when setting string values
- Subject: Glitches when setting string values
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 15 Dec 2002 10:28:05 -0500
I'm playing around with setting a target application's attribute values.
Here are some glitches I find in settable CFStringRef attributes:
1. I'm targeting TextEdit, which has a clean, empty window open and
frontmost. I call AXUIElementSetAttributeValue on the AXValue attribute of
the AXTextArea element in the AXScrollArea element in the AXWindow element,
to set some text. It works: the text appears in the TextEdit window.
However, the TextEdit document is not dirtied. The little dot does not
appear in the close box of the TextEdit window, and I can close the TextEdit
window without getting a save sheet. (If I do a "Save As" on the TextEdit
window, the document is in fact saved with the added text.)
I haven't tried this yet on other text-based applications, or on
applications where I might try setting a checkbox or whatever. Should I
expect the document to be dirtied? Is this glitch unique to TextEdit? Is
this a Carbon vs. Cocoa issue?
2. Same scenario, except this time there is some text in the TextEdit window
and I attempt to set the value of the AXSelectedText attribute to one of the
words in the existing text
Nothing is selected; instead, the new text is appended to the existing text
in the TextEdit window. This doesn't seem sensible. Why is the
AXSelectedText attribute marked as settable in the first place? What does it
mean for this attribute to be settable? I kinda hoped against hope that the
accessibility system would conduct a search for the word I supplied to
AXUIElementSetAttributeValue, with the first occurrence of that word in the
TextEdit window becoming selected, if present. No such luck.
But I can't think of any other behavior that would make sense. Maybe this
attribute shouldn't be marked settable, if conducting a search is too much
trouble to implement? After all, we can still set the selection by setting
the AXSelectedTextRange attribute [I think -- haven't gotten to that one
yet].
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.