find button coordinates to be used in Control UI

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
husky
Posts: 132
Joined: 29 Oct 2016 13:41
Location: Omaha, Nebraska, USA
Contact:

find button coordinates to be used in Control UI

Post by husky » 19 May 2017 15:38

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
"Basic research is what I'm doing when I don't know what I'm doing"

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: find button coordinates to be used in Control UI

Post by Martin » 19 May 2017 20:13

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

User avatar
husky
Posts: 132
Joined: 29 Oct 2016 13:41
Location: Omaha, Nebraska, USA
Contact:

Re: find button coordinates to be used in Control UI

Post by husky » 20 May 2017 01:15

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
"Basic research is what I'm doing when I don't know what I'm doing"

Post Reply