Jump to content

Recommended Posts

Posted

Very new to autoit and certainly not an amazing programmer by any means. Love it so far. One situation I've run into that I hope someone can help me with is the best method to tell a scrpt a document has loaded into a program. I'm running reports from a program called cognos, then taking screenshots of the data. Due to the size of the database it pull from it can take upward of a minute to do it. Sometimes more, depending on the time of day, network utilization, etc. Right now my script is just setting an arbitrary sleep time of 100000 which seems to be working, but if it's particularly slow on any given day, I'll just end up taking a snap of a white screen. Winwaitactivate won't necessarily work because the title has loaded, even if the report hasn't.

Hoping someone here might be able to guide me in the right direction. Thanks

Posted (edited)

Have you tried the text inside the window? Or maybe the status bar?

Edit: Or, you can wait until the pixels on teh screen are no longer white, then sleep for short while (3 secs) just in case, then take a snapshot.

#)

Edited by nfwu
Posted

Have you tried the text inside the window? Or maybe the status bar?

Edit: Or, you can wait until the pixels on teh screen are no longer white, then sleep for short while (3 secs) just in case, then take a snapshot.

#)

thanks for your help. I was initially thinking of the status bar as well, but cognos doesn't list any text there even when the document is finally loaded. I eventually went with a similar idea to your pixel idea, and used the following script to look for a specific color on the screen.

CODE
Do

$p = PixelGetColor(357, 439)

Sleep(100)

Until $p = 0xC4C750

Works great!!! Now all I have to do is learn how to use coordinates instead of pixels ( that's for another day )

Thanks again for your help

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
×
×
  • Create New...