Jump to content
Sign in to follow this  
brimoner

IF statement

Recommended Posts

brimoner

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

Share this post


Link to post
Share on other sites
seandisanti

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.

Share this post


Link to post
Share on other sites
brimoner

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

Share this post


Link to post
Share on other sites
seandisanti

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.

Share this post


Link to post
Share on other sites
brimoner

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

Share this post


Link to post
Share on other sites
seandisanti

Thanks again. I'll try it tomorrow.

Sean

Np, glad to help. Did you get your other issue worked out?

Share this post


Link to post
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
Sign in to follow this  

×