Good day,
I'd like to find ways to more intelligently control my scripts. Many times I cannot access a control easily with MS (more lack of knowledge then anything else, I'm sure), and I'd like to master MS better by learning how to better read the screen intelligently, especially when I cannot see a control from the app. A good example is I'm using screen shots to look for things that change, but in one case, I have a box that contains a % done and I'd like to be able to sample that box and read the info in it and see if things get hung. Right now, I've got a timer that considers things a fail if things take more then 60 minutes.
This may be further training by you Marcus, which I'm up for, but I'd like to really start digging much deeper with MS.
Thanks,
Frank
Intelligent Script Control
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Intelligent Script Control
Is the progress bar in an application, a web page, or something else? It's quite possible the one of the built in Macro Scheduler Wizards can help you extract that value. Which wizard, of course, depends on how the percentage is being displayed.
A few places that might be worth investigating :
The Find Object Wizard
The Find IE Element Wizard
The Text Capture Wizard
Also, does your progress counter have any kind of progress bar? If so, you could use GetPixelColor to monitor progress.
A few places that might be worth investigating :
The Find Object Wizard
The Find IE Element Wizard
The Text Capture Wizard
Also, does your progress counter have any kind of progress bar? If so, you could use GetPixelColor to monitor progress.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Intelligent Script Control
In the particular program that I'm trying to monitor, I've tried just about everything (windows app - Easy Video Suite) and I cannot extract a numerical value from the percentage done indicator. It displays it but darned if I can find a way to extract it.
If I could find a way without snapping 10 to 100 images to monitor how long it stays on a particular value, it would be great. right now I'm using a timed loop that considers the job hung if it takes longer then 3 hours. Not the best way. Mainly because with deductive reasoning I can know that the process is stuck because it sits on the same percentage during conversion for way too long.
To date, I've tried the process tool, the text capture tool and really the only thing that is semi-reliable is image capture with the co-efficient set to 1.
Frank
If I could find a way without snapping 10 to 100 images to monitor how long it stays on a particular value, it would be great. right now I'm using a timed loop that considers the job hung if it takes longer then 3 hours. Not the best way. Mainly because with deductive reasoning I can know that the process is stuck because it sits on the same percentage during conversion for way too long.
To date, I've tried the process tool, the text capture tool and really the only thing that is semi-reliable is image capture with the co-efficient set to 1.
Frank
Re: Intelligent Script Control
Have you thought about using WaitPixelColor> or GetPixelColor> in a loop? I have many scripts where I use GetPixelColor> and scan a small area either waiting for the pixel to become a specific color or sometimes waiting for a pixel to not be a specific color.
For example if you are waiting for a progress bar that perhaps is fancy and changes colors. Usually the background behind where the progress bar is extending remains a specific color. So find the location of the last pixel to the far right (assuming its filling in to the right) of the background and test that location using GetPixelColor> in a loop. When the color is NOT the background color, you know the progress bar has completed.
For example if you are waiting for a progress bar that perhaps is fancy and changes colors. Usually the background behind where the progress bar is extending remains a specific color. So find the location of the last pixel to the far right (assuming its filling in to the right) of the background and test that location using GetPixelColor> in a loop. When the color is NOT the background color, you know the progress bar has completed.
Re: Intelligent Script Control
that's actually a great idea. I can now use math to compute the next pixel positions and watch for the color to change and if it doesn't in a smaller timeframe, then I know I've got issues.
Frank
Frank
Re: Intelligent Script Control
I wanted to thank you again. Your insides have given me a new way to solve an ugly problem. Sometimes I find that I get fixed on the wrong solution. I was able to easily write a new routine that checks the progress bar about every 5 minutes and reports back if it gets stuck!
Thanks
Frank
Thanks
Frank