Jump to content

IF statement


Recommended Posts

I'm working on a script that opens a software program and sends commands to download remote data. This all works great.

The problem is that if an error occurs during the download, an error window pops up, and requires a SEND "Enter" to exit. If the window does not pop up, I don't want to send the "enter".

Is there a function in Auto IT that will send the "enter" if the error window pops up, but continue with the script if the window does not pop up?

Thanks

Sean

Link to comment
Share on other sites

I'm working on a script that opens a software program and sends commands to download remote data. This all works great.

The problem is that if an error occurs during the download, an error window pops up, and requires a SEND "Enter" to exit. If the window does not pop up, I don't want to send the "enter".

Is there a function in Auto IT that will send the "enter" if the error window pops up, but continue with the script if the window does not pop up?

Thanks

Sean

check out AdlibEnable() in the help file. you can have an adlib function watch for the error message and deal with it if it pops up.
Link to comment
Share on other sites

check out AdlibEnable() in the help file. you can have an adlib function watch for the error message and deal with it if it pops up.

O.K. that works great! Thanks.

Another question...how do I tell the script to advance to a certain line in the code, once the error window is closed? kinda like a GOTO statement. If WinActive (error window) send (enter) then goto line XXX and continue running the script.

Sean

Link to comment
Share on other sites

O.K. that works great! Thanks.

Another question...how do I tell the script to advance to a certain line in the code, once the error window is closed? kinda like a GOTO statement. If WinActive (error window) send (enter) then goto line XXX and continue running the script.

Sean

use winwait()'s etc to make sure your main thread waits for each window before continuing, so that if the error window pops up, it's already waiting for the next window to come up, then your adlib kills the error window, and the correct window comes up, then the script continues as it should.

-Sean also.

Link to comment
Share on other sites

use winwait()'s etc to make sure your main thread waits for each window before continuing, so that if the error window pops up, it's already waiting for the next window to come up, then your adlib kills the error window, and the correct window comes up, then the script continues as it should.

-Sean also.

Thanks again. I'll try it tomorrow.

Sean

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...