Sorry for re-opening an old thread everyone, but I seem to be having nearly the exact same problem as SmokeyDaBears and I cannot seem to find any more information about this issue!
I am using AutoIT (v3.2.12.1) as a test tool for my application. I wrote my test scripts on two separate machines, and on either of those machines they run cleanly without any problem, whether running in .au3 format or compiled script format. However, when I moved to my customer test bed (which is identical to one of my two dev machines except that it has 1Gb less ram) I get the same kind of occasional stall or hang on File->Open inside my application. (Error happens with both script and compiled script.)
I call it an occasional failure because it seems to randomly happen. Sometimes it will happen 2-3 times when running 10 times, othertimes not at all when I run the script 20 times!
Based on logging messages that I have added to my script, I know that the script is running away even though the application is paused - i.e. that the script continues to run even though the application is hung at the File->Open menu. I even added a return code check for each item from ControlSetText on and they ALL pass!
CODE; 1. start my app
Run("myApp.exe")
$retval = WinWaitActive($TITLE_MAIN_WIN, "Ready")
if ($retval == 0) then
Exit(-1)
EndIf
; 2. File->Open window (this bit does some extra checking to try to make sure it waits for the dialog to be open!)
Send("!fo")
; $TITLE_OPEN = "Open"
if not WinActive( $TITLE_OPEN ) Then
WinActivate( $TITLE_OPEN )
EndIf
$retval = WinWaitActive( $TITLE_OPEN,"",2)
if (0 == $retval) then
WinClose($TITLE_MAIN_WIN)
WinWaitClose($TITLE_MAIN_WIN, "", 2)
exit(-1)
EndIf
;put image file name File name edit box, click Open button
;Edit1 is the field to put in the filename in. It is right since my script usually works
ControlSetText($TITLE_OPEN, "", "Edit1", $imagefile)
;Button2 is the "Open" button - I have the right button since my script usually works
ControlClick($TITLE_OPEN, "", "Button2")
; Do other processing - which my script definitely gets to even when the application is still waiting on the File Open dialog.
Can anyone help? To summarize, my application is hanging at the File->Open dialog box, with no text entered in the filename field. The script keeps right on going, thinking that it has already entered the filename and clicked on OK.
Thanks.