Using FindImagePos and MouseMove, but with an offset

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
brianjones11
Newbie
Posts: 1
Joined: Sat Mar 01, 2008 6:46 pm

Using FindImagePos and MouseMove, but with an offset

Post by brianjones11 » Sat Mar 01, 2008 7:01 pm

I am trying to click on a checkbox, SetCheckBox doesn't work in this case (its a Java application), so I have been using FindImagePos. It finds the image fine, and I get the position of the top left of the image as X_0,Y_0, just as in the example. MouseMove>X_0,Y_0 works fine. I want to add an offset to X_0,Y_0, to click the checkbox, but whatever I do I get an error message complaining that the parameters to MouseMove are non-numberic. I think I've tried most combinations ! I'm sure its really simple, but how can I do:

FindImagePos>monday_en.bmp,select.bmp,0,0,X,Y,NumFound
If>NumFound>0
Let>clk_x = X_0 + 10
Let>clk_y = Y_10 +10
Mousemove>clk_x,clk_y

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Mar 01, 2008 9:36 pm

Remove the spaces (unless you are using the IGNORESPACES directive):

Code: Select all

FindImagePos>monday_en.bmp,select.bmp,0,0,X,Y,NumFound
If>NumFound>0
  Let>clk_x=X_0+10
  Let>clk_y=Y_10+0
  Mousemove>clk_x,clk_y
Endif
Also, you can tell FindImagePos to return the centre point of the matching location:

FindImagePos>monday_en.bmp,select.bmp,0,1,X,Y,NumFound
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts