Most of these events are notification and not input events so dispatching
them has no effect. I think you'll have to "play back" a
TEXT_SELECTION_CHANGE by calling setSelection()
I am doing a setSelection "play-back" as explained in the first half of my post.
But it does not work all the time.
Hence I am forced to think of different ways of doing this.
Is there no way that I can simulate 'CTRL+A'?
If I understood, you are trying to dispatch an event you recorded. I'm
surprised it changed selection at all. I didn't see any mention of actually
calling the setSelection API.
When recorded, the event is Text_Selection_Change, which I am trying to replay.
SetSelection is not a recordable event.
So, I am trying to replay Text_Selection_Change with a twist.
I want to do it using CTRL+A, as it would ensure complete selection.
Text_Selection_Change also requires beginIndex and endIndex, just like setSelection.
The only problem is that the Automation object is giving the wrong length of the text sometimes.
I am using beginIndex = 0, endIndex = automationObject["text"].length.
This is not working correctly sometimes.
So, I am trying to dispatch CTRL+A instead.
I am not too sure that I can use the automation object to do a setSelection.
Maybe you're recording the wrong text variable or not storing and fetching
I am not fetching the test variable incorrectly.
I just double-checked. Anyway, there is only way way you can get the text through an automation object and I am using it.
Could you let me know if it is possible to simulate 'CTRL+A'?
It should be possible, if you have an accurate length of the text and call
setSelection(). Sounds like there is an issue getting the accurate length