Webpage box enter

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
Theowi
Posts: 16
Joined: 08 Jan 2015 11:45

Webpage box enter

Post by Theowi » 15 Jan 2015 01:08

How do i get automagic to insert a text into an empty text-box on a webpage? Pls assist

I uploaded an image
Attachments
login.PNG
login.PNG (2.44 KiB) Viewed 21562 times

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

Re: Webpage box enter

Post by Martin » 16 Jan 2015 11:15

Hi,

Many browsers don't provide the required accessibility information to detect the input fields and to enter text so you could try to send keyboard input to the browser with action Control UI and function sendText or function sendKey.
Depending on browser you could also fill out a form with a Javascript Bookmarklet.

You could also resort to action Execute Root Command with commands input tap x y to simulate touch input or input text xyz (not supported on all ROMs).

Regards,
Martin

Theowi
Posts: 16
Joined: 08 Jan 2015 11:45

Re: Webpage box enter

Post by Theowi » 23 Jan 2015 00:08

Could you pls write me a flow.... i will self get the x,y location... when i tried the Sendtext it didnt work because i couldn't get it to go to that box location... i even tried the overlay option....

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

Re: Webpage box enter

Post by Martin » 23 Jan 2015 09:18

Clicking on a x,y location in a browser will most likely not work.
You can use sendKey to navigate between fields, for example like this:

-action Control UI with script:

Code: Select all

sendKey("TAB");
sleep(500);
sendText("My Name");
The first line moves input focus to the next field. On chrome it moved the input focus to the first field when no field was focused before.
The second line waits half a second since it might take the browser a short amount of time to properly execute the first line (depending on browser this line might not be required).
The third line enters 'My Name' into the field that has focus.

Note that the input method of Automagic has to be enabled and active to execute the above script.

Theowi
Posts: 16
Joined: 08 Jan 2015 11:45

Re: Webpage box enter

Post by Theowi » 26 Jan 2015 10:09

Thanx.... Alot Martin it works now.... Will ask for your assistance again when I have a problem....

dragon
Posts: 29
Joined: 10 Sep 2015 08:13

Re: Webpage box enter

Post by dragon » 23 Jun 2016 16:25

Hey guys, I have a question about inserting text into a field.

Suppose I open an app, and the cursor is already set in the password field of the app.
I want Automagic to type in my password for me and open up the app. (the app requires me to input password for entry)

So my flow triggers when the app opens,

then if I make an action to Control UI...

sleep(100);
sendText(".....");
sleep(100);

... I get an error that Automagic input method is not selected. Am I to conclude that I have to set Automagic input to send text to a field/element?
I can get it to work if I add Automagic input method before the action, and then change input method back to swiftkey after action but I feel like this might be not necessary. Is there not a way to send text to a field without invoking Automagic input method?

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

Re: Webpage box enter

Post by Martin » 24 Jun 2016 19:22

Hi,

The Automagic input method is required to simulate keyboard input. You could try to use function paste to insert text into the field. Unfortunately the current version of Automagic requires to define the coordinates of the component to paste the text. The next update will also provide functions to set the text in the currently focused component.

On a rooted device you could also use Execute Root Command: input text xyz to simulate typing text.

Regards,
Martin

Post Reply