Jump to content
Sign in to follow this  
sfresher

Pause the script until one of the windows exists?

Recommended Posts

sfresher

I want to pause the script until one of the windows exists. So I used the following code:

<autoit>

WinWait ("Window 1" OR "Window 2" OR "Window 3")

</auoit>

But it appears that the code doesn't work. It hangs there forever.

Share this post


Link to post
Share on other sites
Xand3r

I want to pause the script until one of the windows exists. So I used the following code:

<autoit>

WinWait ("Window 1" OR "Window 2" OR "Window 3")

</auoit>

But it appears that the code doesn't work. It hangs there forever.

WinWaitClose
WinWaitNotActive

Cheers.


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites
AdmiralAlkex

I want to pause the script until one of the windows exists. So I used the following code:

<autoit>

WinWait ("Window 1" OR "Window 2" OR "Window 3")

</auoit>

But it appears that the code doesn't work. It hangs there forever.

That's not how you use Or, and you can't use WinWait for this. It should be more like

do
sleep(50)
until WinExists("Window 1") or WinExists("Window 2")

Share this post


Link to post
Share on other sites
Xand3r

ohh sorry i'm kinda sleepy i read

until a window exits

:) the first time

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites
sfresher

Thanks! This is exactly what I wanted to do. But one more question, what if I want to wait, but no longer than 5 minutes. How can modify the script? use a counter in a for loop?

That's not how you use Or, and you can't use WinWait for this. It should be more like

do
sleep(50)
until WinExists("Window 1") or WinExists("Window 2")

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.