Sign in to follow this  
Followers 0
RickB75

question about WinWaitNotActive

3 posts in this topic

Guys,

       We have an internal system here at my work that auto runs reports for us on a daily basis. I have a script that goes in each day and goes through the keystrokes to navigate to the correct screen and downloads the reports I need. Every so often (normally once every week or two weeks) the script will error. The reason why is because my file count that I download daily changes. Some days it's 10 files and some days it's 25. The sizes of the files change as well and that affects how long the window will stay open. I know I could probably tell the script to sleep for 5 mins and it would work fine (i think) but I was wondering if there could be a better way. 

I've tried to get the daily report count into an array and just use that and a While loop but there is nothing I can find in the system that will give a total count / number.

For each file that gets downloaded a "Save in Progress ..." window pops up, the file gets downloaded and the "Save in Progress ..." closes and reopens when the new file starts downloading.

Some days there will be 10 of these windows and some days there will be 25 of them.

My question is if I use  WinWaitNotActive like this:

Opt("WinWaitDelay",6000);Set WinWaitNotActive to six secs.
Do
    Sleep(3000)

Until   WinWaitNotActive('Save in Progress ...')


Opt("WinWaitDelay",250);Reset WinWaitNotActive to default

Does it look for the first "Save in Progress ..." window to not be active or when it returns from the pause and checks then? Right now it appears it's looking for the first download because I have the script set to close the window after it's done but instead, it's closing the previous window, which thats the next item in the script. I'm just curious how you guys would attempt to fix this.

 

Share this post


Link to post
Share on other sites



Thanks John. I'll keep playing around with it.

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