I am trying to write some automation tools for a $10K piece of engineering software, which unfortunately means most of you won't be able to test run anything to solve my problem (unless we arrange for a screen share in a PM).
This is my first attempt with AutoIt, and so far I love it! Creating a GUI for my script was easy, the documentation was easy, and everything works great EXCEPT ONE ITEM:
The software I am automating is SKM Power*Tools, and it's not the most up-to-date software, but at one point my script pulls up a window inside the program. The window has two plot areas, which I'll refer to as "TCC" and "Oneline". Both of those areas have "Datablocks" which can be toggled on and off my clicking a button on a toolbar in the program main window. The area to toggle the "Datablock" in is determined by which ever area has been clicked in most recently. If neither have been clicked it defaults to the "TCC" plot area. When this window is opened, "Datablocks" are ON for the "TCC" area, and OFF for the "Oneline" area. Using the script to toggle the "Datablock" in the "TCC" area is no problem, since that area has default focus. However, I have not been able to get the "Datablock" in the "Oneline" area to toggle. My script clicks in the "Oneline" area (and I know it works, because plot objects that were initially selected are unselected as soon as my script clicks), and then clicks the toggle button in the toolbar. However, the "Datablock" in the "Oneline" area does not toggle, and instead the "Datablock" in the "TCC" area toggles, indicating to me that the focus did not stay on the "Oneline" area when the toggle button was clicked...
Below are some code snippets. I would really appreciate any help you can give! This bug is all that stands between me and a 50% labor reduction for certain aspects of some engineering projects!
All of my $SuccessTest checks show that the clicks succeeded. It just doesn't work right in my software! I've tried several different ways to define the control to be clicked (as determined by the Window Info tool), but nothing has solved this problem. Again, it appears my control IS getting clicked, it's just not changing the focus so that the toggle button will work correctly.
Thanks a lot,
Diakonos1984
This is my first attempt with AutoIt, and so far I love it! Creating a GUI for my script was easy, the documentation was easy, and everything works great EXCEPT ONE ITEM:
The software I am automating is SKM Power*Tools, and it's not the most up-to-date software, but at one point my script pulls up a window inside the program. The window has two plot areas, which I'll refer to as "TCC" and "Oneline". Both of those areas have "Datablocks" which can be toggled on and off my clicking a button on a toolbar in the program main window. The area to toggle the "Datablock" in is determined by which ever area has been clicked in most recently. If neither have been clicked it defaults to the "TCC" plot area. When this window is opened, "Datablocks" are ON for the "TCC" area, and OFF for the "Oneline" area. Using the script to toggle the "Datablock" in the "TCC" area is no problem, since that area has default focus. However, I have not been able to get the "Datablock" in the "Oneline" area to toggle. My script clicks in the "Oneline" area (and I know it works, because plot objects that were initially selected are unselected as soon as my script clicks), and then clicks the toggle button in the toolbar. However, the "Datablock" in the "Oneline" area does not toggle, and instead the "Datablock" in the "TCC" area toggles, indicating to me that the focus did not stay on the "Oneline" area when the toggle button was clicked...
Below are some code snippets. I would really appreciate any help you can give! This bug is all that stands between me and a 50% labor reduction for certain aspects of some engineering projects!
[ autoit ]
$HandleTCC = WinWait($HandleSKM,"TCC") ;wait until window is up. ;$HandleSKM is previously defined as the program main window ConsoleWrite("TCC window has come up now: " & $HandleTCC & @CRLF) ;Oneline zoom and datablock toggle ConsoleWrite("Attempting to click oneline..." & @CRLF) ;The following line appears to successfully click the "Oneline" area, because ;any selected devices in the area are unselected when this runs, ;just as they would be if I manually clicked in the area. $SuccessTest = ControlClick($HandleTCC,"","[CLASS:AfxFrameOrView42; INSTANCE:1]","primary",2,147,167) If $SuccessTest = 1 Then ConsoleWrite("Succeeded." & @CRLF) If $OData = 1 Then ;a condition based on a radio button in my GUI ConsoleWrite("Attempting to toggle oneline datablock..." & @CRLF) $SuccessTest = ControlClick($HandleSKM,"","[ID:33002]","primary",1,137,12) ConsoleWrite("Oneline datablock toggle success: " & $SuccessTest & @CRLF) Else ConsoleWrite("Oneline datablocks not toggled." & @CRLF) EndIf Else ConsoleWrite("Failed." & @CRLF) EndIf
All of my $SuccessTest checks show that the clicks succeeded. It just doesn't work right in my software! I've tried several different ways to define the control to be clicked (as determined by the Window Info tool), but nothing has solved this problem. Again, it appears my control IS getting clicked, it's just not changing the focus so that the toggle button will work correctly.
Thanks a lot,
Diakonos1984