Page 1 of 1

Smart way to use MoveToObject (for different resolution)?

Posted: Mon Nov 07, 2016 3:00 pm
by snowseals
Is there smart way, like calculating, where the pixels will be on a different resolution?

Like for ex., I made all the scripts for 1920x1080.
Now I want to use the same scripts, on a different resolution on a laptop, like 1280x800.

I also saw something like Relative pixels, but I guess that only shows when using the Wait for Pixel -instance.

Is there some formula, so I can calculate the new positions/pixels in the script so the mouse cursor will be on-point?
Otherwise, I'll have to re-record the scripts again, on the other resolution.

Re: Smart way to use MoveToObject (for different resolution)

Posted: Mon Nov 07, 2016 3:22 pm
by snowseals
Would this suffice?

Like 1920 = 100% / 100 = 19,20 x 1280 = 66,67%
As shown in attachment, Mouse Cursor Position for X = 565 at 1920 = 100%
565 / 100 = 5,65 x 66,67 = 376,68 is new Mouse Cursor Position for X?

Or is there an alternative/simpler way to convert/create the new postion?

Re: Smart way to use MoveToObject (for different resolution)

Posted: Mon Nov 07, 2016 4:03 pm
by Oleg
Mouse actions are very dependent on current screen resolution.
There are no universal mechanism to calculate new element position because different windows have different behavior when it works in another size.

You can use VB script (or VB Evaluate) action if you want to use proportional calculation of new position.

Re: Smart way to use MoveToObject (for different resolution)

Posted: Mon Nov 07, 2016 4:11 pm
by Oleg
Another recommendation:
You can change window size and position before usage of mouse action.
Look at the action Window Size and position

Fore example change change size of window to 800*600 and use fixed mouse coordinates.