Hi,
I wanted to scroll a table precisely to do some data collection. Here i can't use Arrow Down Key to scroll because it is not precise. Here is an example table:
I was thinking to scroll it using vertical slider and use image recognition make it precise.
What if we capture the Image from Blue Color Box and scroll the table by one step coordinate (y-axis) using MouseMove and check that image same image in Red Color Box, and repeat the loop until the image will be found inside the red box.
Here i cant fix the coordinates in MouseMove because the number of rows are keep on changing in the table so one time it works but other time the script break down.
Is the above method possible to scroll or is there any better alternative for that?
Thanks!
Regards,
Ushahra
How to scroll a table precisely using Image Recognition
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1386
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: How to scroll a table precisely using Image Recognition
Just a couple of ideas.
If the scroll bar is always in the same X position you could always use GetPixelColor in a vertical loop until you find green, and then drag the mouse down a few pixels.
Adjust coordinates and increments to suit..
Image Recognition might be quicker though. Look for the green bar, and drag it 50 pixels..
If the scroll bar is always in the same X position you could always use GetPixelColor in a vertical loop until you find green, and then drag the mouse down a few pixels.
Adjust coordinates and increments to suit..
Code: Select all
//Green bar is always at 2890
let>Xpos=2890
Let>Ypos=840
While>PixCol<>5296274
GetPixelColor>Xpos,Ypos,PixCol
Let>Ypos=Ypos+25
Endwhile
If>PixCol=5296274
mousemove>Xpos,Ypos
Ldown
mousemove>Xpos,{(%Ypos%+50)}
LUp
Endif
Code: Select all
FindImagePos>...
If>NumFound>0
MouseMove>XArr_0,YArr_0
Ldown
MouseMove>XArr_0,{(%YArr_0%+50)}
Lup
Endif
Yes, we have a Custom Scripting Service. Message me or go here