I know this is a simple case, but does raise a few questions that I'm not sure have already been answered...
If I utilise the UI functions such as UIClick it appears that the mach criteria for the object name applies some internal logic that appears to cause some problems. It appears that the match can be made on UI Automation Name or UI Automation Value (as indicated in the wizard).
In the case of automating good old calculator.exe, if I have a script as follows:
//Set IGNORESPACES to 1 to force script interpreter to ignore spaces.
//If using IGNORESPACES quote strings in {" ... "}
//Let>IGNORESPACES=1
UIClick>{"Calculator"},{"8"}
UIClick>{"Calculator"},{"8"}
What happens is the first line will click on the button 8, the second line will click on the Result portion of the calculator window (this is because the result object in the UI now has a UI Automation Value of "8").
Is there any way that we can change the behaviour of this search to only search based on "UI Automation Name" rather than UI Automation Value ?
Looking at what I can see in the return from the UIAccessibleList I can see there does appear to be an object with name and value 8 here as well as the button and also as well as the Result object, so I'm guessing that is a part of the problem here... any ideas of ways that we could handle this ?
If we had a way to add an additional requirement to the action which allowed for you to also specify an object size that would allow the search to be more precise. I'm not sure if there is anything else that you could use ? anything that differentiates a button from a text field ??
Output of the UI AccessibleList below:
Code: Select all
System= [417,70,22x22]
System= [417,70,22x22]
Minimise= [530,63,28x21]
Maximise= [558,63,26x21]
Close= [584,63,47x21]
Application= [417,93,212x19]
View= [417,93,39x19]
Edit= [456,93,34x19]
Help= [490,93,39x19]
Calculator= [417,113,212x264]
Running History= [432,126,182x13]
Running History= [432,126,182x13]
Memory= [428,148,14x18]
Memory= [428,148,14x18]
Result= [446,138,167x28]
Result=8 [446,138,167x28]
8= [446,141,167x30]
8= [446,141,167x30]
Memory clear= [428,178,34x27]
Memory clear= [428,178,34x27]
Backspace= [428,210,34x27]
Backspace= [428,210,34x27]
7= [428,242,34x27]
7= [428,242,34x27]
4= [428,274,34x27]
4= [428,274,34x27]
1= [428,306,34x27]
1= [428,306,34x27]
0= [428,338,73x27]
0= [428,338,73x27]
Memory recall= [467,178,34x27]
Memory recall= [467,178,34x27]
Clear entry= [467,210,34x27]
Clear entry= [467,210,34x27]
8= [467,242,34x27]
8= [467,242,34x27]
5= [467,274,34x27]
5= [467,274,34x27]
2= [467,306,34x27]
2= [467,306,34x27]