Jump to content

Program Unresponsive, Script Hangs


MaxG
 Share

Go to solution Solved by MaxG,

Recommended Posts

Hello All,

I'm very new to AutoIT and I could not find my situation described elsewhere, so I'm hoping to find insite here.

The script is pretty simple, its just interacting with software menus and dialogs.  What I don't understand is why the script doesn't end after it successfuly executes the final ControlClick statement...  I have to ctrl+Break to end it.

Now, as soon as this last ControlClick statement performs its task, the program I'm interacting with goes unresponsive and gray for about 15 seconds before returning to an active state (which is normal for this application)....  this seems to confuse the script and it acts like its in an endless loop.

As a test I placed a MsgBox immediately following the last ControlClick statement.... and it never executes even though the ControlClick does what its supposed to...

I'm very puzzled, please if anybody has some thoughts on this I would really appreciate it.

Thanks!

MaxG

; Script Start - Add your code below here

;Activates the Program Window
WinActivate("BCC")

;Clicks the "New List" button.
ControlClick("BCC","", "[CLASS:TToolBar; INSTANCE:3]", "left" ,1, 10,15)

;Clicks the "Use Template..." option and navigates the popup menu to find the Non-Auto template.
send("{down}{down}{enter}")
send("Non-Auto{enter}")

;Interacts with save dialog, ending with sending the name and simulating enter.
WinWaitActive("Save New List As")
ControlClick("Save New List As","", "[CLASS:Edit; INSTANCE:1]")
Send("Test{enter}")

;Deal with confirmation dialog.
WinWaitActive("Confirm Save As")
ControlClick("Confirm Save As","", "[CLASS:Button; INSTANCE:1]")       ;Final Control Click statement
;MsgBox(0,"Test","Please do something!") <---- This never takes place when uncommented

;The final ControlClick statement is the last to execute....
;Sleep(20000) tried this before the app hang, didn't help no matter how long I make the scrip wait....
Link to comment
Share on other sites

  • Solution

I apologize - I figured out what my issue was.  Basically, I've been using a test .dbf file and the script is setup to handle an "ok to overwrite" dialog, but after I say "ok to overwrite" if I cancel a few screens later I lose the original .dbf I was working off of...

Subsequent script runs were hanging because the "ok to overwrite" dialog is no longer displayed and the script was waiting for it...     :ranting:

 

Edit:

If anyone else comes across this, I added a MsgBox between each statement in the area that seemed to hang up the script.  This helped me isolate exactly which statement was giving me problems.

Edited by MaxG
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...