Jump to content

Pause the script until one of the windows exists?


sfresher
 Share

Recommended Posts

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

Link to comment
Share on other sites

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")
Link to comment
Share on other sites

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