CheckBox checked?

Post your questions and help other users.

Moderator: Martin

Post Reply
renardi
Posts: 2
Joined: 25 Jun 2013 09:50

CheckBox checked?

Post by renardi » 25 Jun 2013 11:47

Hello,

When a bluetooth device (external GPS) is connected I want to lanch an app (GpsInfo, maps external GPS to mocking locations). Check a checkbox in the app, move app to background, and then start a navigation app (Google navigation, TomTom,...)

So I think I have to write a UI script that checks the checkbox and if checked lanches the nav app. If the checkbox becomes unchecked, because it was checked already, it should check it again. It has to be like this because when GPSinfo is restarted and the checkbox wasn't unchecked when the app was closed it shows checked on startup of the app. In delphi it would look something like this:

var T:Integer; //Try max 50 times

T:=0;

While (not Cb.Checked) Or (T=50) do begin

Cb.Checked:= True;
T:= T+ 1;

If (Cb.Checked) then begin

[close Gpsinfo] //Press BackButton
[launch nav app]
end;
end;

How would I convert this to UI script?

Thanks in advance,

Christophe,
Belgium.

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

Re: CheckBox checked?

Post by Martin » 25 Jun 2013 17:20

Hi,

First you have to find the coordinates or the name of the checkbox:
1) Create an empty flow and add an action Control UI and press the button Show Overlay Control.
2) Two red buttons Info and Close should be displayed at the top of the screen.
3) Go to the home screen and launch the app containing the checkbox you want to modify.
4) Press the red button Info to highlight the control elements available on the screen.
5) Click in the green rectangle containing the checkbox of interest. A list with commands like "check(620, 210)" should be shown.
6) Select "check(x, y)" or "check("checkbox name")" to copy the command to the clipboard.
7) Press the red Close button to hide the overlay and go back to Automagic.

Edit the action Control UI and paste the "check(x,y)" command.

A flow containing the action could look like this:
-trigger Bluetooth Device Connected
-action Launch App: GPSInfo (directly start the screen with the checkbox if possible)
-action Sleep: 5s to give the app some time to properly show on screen
-action Control UI: check(x,y)
-action Launch App: Navigation App

Regards,
Martin

renardi
Posts: 2
Joined: 25 Jun 2013 09:50

Re: CheckBox checked?

Post by renardi » 26 Jun 2013 15:37

Thanks for the reply Martin.

I wasn't aware that the bluetooth connection with the external GPS isn't started until you click the checkbox.

So the flow kicks in after checking the checkbox...and then starts the nav app.

Post Reply