Sign in to follow this  
Followers 0
Swimming_Bird

Script to wait for particular windows to open

5 posts in this topic

I wanted to a script to wait for any window to open and then if that window is one of the windows i'm looking for have it perform a particular aciton.

It's easy enogh with one window, but i dont want a different script for every window that i want to deal with.

While 1
    WinWait ( 'Alert' )
    WinClose ( 'Alert' )
WEnd

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

<3

1 quick question. will this be pretty nasty for resources? Is there any way to trigger it to just do the select when a new window appears?

Edited by Swimming_Bird

Share this post


Link to post
Share on other sites

That way it will require you to constantly check all existing windows against all previous windows, which is more resource intensive. Keeping it simple is generally the best way to keep it resource friendly.

Share this post


Link to post
Share on other sites

You are going to need code to check if a new window does appear which will eat resources anyway, so you will not evade the checking. A Sleep of 1 second should not be a problem. If you have a lot of windows then perhaps using the Regular expression option 4 in a Win* function may provide more effective saving of resources and proceed with the Select statement only if the condition is true.

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  
Followers 0