MouseMove returns incorrect positions

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Alpha_AI
Pro Scripter
Posts: 61
Joined: Wed Sep 19, 2007 9:30 am

MouseMove returns incorrect positions

Post by Alpha_AI » Thu Sep 20, 2007 4:53 am

Hey guys,

Im new here and just recently downloaded the demo trying it out
and im seem to be getting the wrong x and y values
The code opens photoshop, creates a new document, creates a new layer
selects the U tool then it is supposed to move to
this position MouseMove>479,279 but instead it moves to this position 483,299
and its supposed to end at this position MouseMove>1463,415
but instead it ends at this position 1467, 435

Weird.

Anyone knows what the problem is?

Heres the script.

Let>RP_WINDOWMODE=3
Let>RP_WAIT=2
Run Program>C:\program files\adobe\adobe photoshop cs2\photoshop.exe
WaitWindowOpen>Welcome Screen
SetFocus>Welcome Screen
Press Enter
Press CTRL
Send>n
Release CTRL
Send>Websitename1
wait>1
Press Tab
Press Up
Press Up
Press Tab
Send>1000
wait>1
Press Tab
Press Tab
Send>768
wait>1
Press ENTER
Press SHIFT
Press CTRL
Send>n
Release SHIFT
Release CTRL
Send>HeaderBorder
wait>1
Press ENTER
WaitWindowOpen>Websitename1*
SetFocus>Websitename1*
Send>f
//Create the header
Send>u
Wait>1
**BREAKPOINT**
MouseMove>479,279

wait>1
LDown
MouseMove>1463,415
wait>1
LUp

//Create the gradient
//Send>u
//MouseMove>590,123
//LDown

//MouseMove>590,231
//LUp

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Sep 20, 2007 5:07 am

You're off by 4 on the X and 20 on the Y so I'm guessing this is the size of the border on the X and the title bar on the Y. MouseMove gives you screen positioning and I think you're looking for window positioning. Try MouseMoveRel> instead. It moves the mouse relative to the position of the currently focused window.

Alpha_AI
Pro Scripter
Posts: 61
Joined: Wed Sep 19, 2007 9:30 am

Thanks JRL

Post by Alpha_AI » Fri Sep 21, 2007 7:04 am

Good noticing.

The border is the problem
so i added 4 and 20 onto the value and it works fine.

Thanks

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