Is there a way to center the mouse in the middle of the active window on the screen?? I want to do this because i am using waitcursorchanged> in my script and just in case its not centered in the app, i might end up with unwanted results. Now if it centers to the middle of the screen itself and not the app, that will work as well.
This is what i am waiting on:
//press enter to start report generation
press enter
wait>4
//waiting on cursor to change from hourglass
WaitCursorChanged>7000
wait>.3
SetFocus>Crystal Reports for Macola - [WO Items to Pick List3m.rpt]
wait>.2
Thanks
Center mouse cursor in app
Moderators: Dorian (MJT support), JRL
Center mouse cursor in app
Just when you thought it was safe to go in the water........
- Marcus Tettmar
- Site Admin
- Posts: 7391
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Sure:
Code: Select all
//get x,y and width and height of active window
GetActiveWindow>title,x,y,w,h
//now some elementary math to calculate the middle of the window
Let>xpos={%x%+(%w% div 2)}
Let>ypos={%y%+(%h% div 2)}
//put the mouse there
MouseMove>xpos,ypos
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?