how to set screen touch coordinates as a macro?

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
lordluca
Posts: 1
Joined: 18 Apr 2015 22:31

how to set screen touch coordinates as a macro?

Post by lordluca » 18 Apr 2015 22:39

Hi all!

i want to automate an app, so:

1. i set trigger (location)
2. set launch app

and now:

in that app i want to 'press' ok button, then, on the next screen press another button, and then swipe right.

i recorded coordinates in another app, which looks like this:

:start
touchDown 0 495 485
sleep 75
touchUp 0
sleep 4952
touchDown 0 281 928
sleep 108
touchUp 0
sleep 2941
touchDown 0 241 275
sleep 33
touchMove 0 246 271
sleep 13
touchMove 0 248 270
sleep 3
touchMove 0 252 269
sleep 9
touchMove 0 257 267
sleep 9
touchMove 0 263 266
sleep 9
touchMove 0 270 265
sleep 14
touchMove 0 276 264
sleep 7
touchMove 0 285 263
sleep 11
touchMove 0 294 262
sleep 8
touchMove 0 302 262
sleep 13
touchMove 0 311 262
sleep 5
touchMove 0 318 261
sleep 8
touchMove 0 327 261
sleep 9
touchMove 0 336 261
sleep 10
touchMove 0 344 261
sleep 12
touchMove 0 353 261
sleep 7
touchMove 0 362 261
sleep 17
touchMove 0 375 261
sleep 2
touchMove 0 386 260
sleep 11
touchMove 0 397 260
sleep 6
touchMove 0 409 260
sleep 11
touchMove 0 421 260
sleep 9
touchMove 0 432 260
sleep 10
touchMove 0 443 260
sleep 6
touchMove 0 455 260
sleep 16
touchMove 0 466 260
sleep 8
touchMove 0 476 260
sleep 6
touchMove 0 485 262
sleep 10
touchMove 0 492 263
sleep 8
touchMove 0 497 264
sleep 11
touchMove 0 502 265
sleep 8
touchMove 0 506 266
sleep 9
touchMove 0 509 267
sleep 8
touchMove 0 512 267
sleep 10
touchMove 0 515 265
sleep 35
touchUp 0

:end

and now i want automagic to perform this actions

OR...

maybe is better way to execute some in app commands like clicking buttons and moving sliders? if yes, can you show me how?

have a great day!

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

Re: how to set screen touch coordinates as a macro?

Post by Martin » 20 Apr 2015 18:05

Hi,

You could use action Control UI to automate button presses and other interactions with regular control elements. Please note that the capabilities of the action are limited when it comes to interactions within certain apps like games and browsers which don't provide the necessary information for Automagic to control the elements.
In such cases and you can resort to action Execute Root Command with commands input tap x y or input swipe x1 y1 x2 y2.
Sometimes it's also helpful to simulate keyboard input with action Execute Root Command: input keyevent. Please use the [...]-button to select the command since Automagic offers a list to pick the keys from.

Please check out this page for some more information:
DIY-Actions: Execute Command, Execute Root Command

Regards,
Martin

Post Reply