Page 1 of 1

find button coordinates to be used in Control UI

Posted: 19 May 2017 15:38
by husky
Hello,

I'm trying to use Control UI to turn on/off GPS based on the script example in the Help.

Also I'd like to use "Boolean touchGesture(Number startMillis, Number endMillis, List coordinates, ...)" or perhaps use Boolean click(Number x, Number y).

Question:

How can I find the screen coordinates for the on/off button in the GPS screen in order to plug it into the touchGesture simulation or X,Y in Boolean click(...)?

Thank You

Husky

Re: find button coordinates to be used in Control UI

Posted: 19 May 2017 20:13
by Martin
Hi,

You can use the gesture recording feature of Automagic (requires Android 7+): open action Control UI and click Show Overlay Control. Now press the red Gesture button at the top of the screen. You can now touch the screen or drag the finger around to record a gesture. After pressing OK, Automagic copies the recorded gesture to the clipboard. You can paste it in the script editor text field.

Alternatively you can use the red Info button to show the green outlines around buttons and other elements. Clicking in a green rectangle shows the functions with the proper coordinates.

Last but not least you could also go to System settings->'Developer options' and enable Pointer location to show the coordinates of the touch location on the screen.

Regards,
Martin

Re: find button coordinates to be used in Control UI

Posted: 20 May 2017 01:15
by husky
Martin,

All I can say is WOOOOWWWWW !!!!

Thanks for the explanation. It works like a charm.

Your explanation was perfect. No need to think twice to make it work. Excellent!!!.


Best Regards


Husky