Jump to content

question about WinWaitNotActive


Recommended Posts

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.

 

Link to comment
Share on other sites

Lower your Sleep in loop.

The window could disappear and reappear in 3 seconds.

 

Or get a handle to it when it appears with winwaitavtive and use that with WinWaitClose.

Just a few things to think about.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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