I am researching the Microsoft UIAutomation for controlling text, but am finding it useless. I need to do things like:
- Get caret position
- This article implies to me that I need to track the caret, which will not work if I do not know it's original position....
- Insert text in a specific location
- Only found the ability to overwrite the entire field using
ValuePattern
'sSetValue
- Only found the ability to overwrite the entire field using
- Set font weight
- I can read the font weight, but cannot set it
- etc
I have read a number of articles by this point, and none point to the possibility of these. This SO question was helpful to get me started, however when I tried to dig deeper I kept running into more questions than answers. Is my only option to go to MS Accessibility Automation, which does not play well with WPF virtualization among other things.
If anybody can point me to a useful article or provide examples for the above shortcomings, that would be great. However, I am not hopeful at this point as it all seems to lead to ways to get information, but not update information.
EDIT
I have even tried to dig into the UIAutomationClient.dll
and it seems that there is, indeed no support for this. It seems UIA is primarily for pulling cursory information and clicking around. No real text support
Here is another SO question...relatively similar to this one...it seems to verify that UIA is useless for my needs..
Hacky Workaround
The workaround we have is to get the general context using UIA and then using AutoIt SendKeys