[Solved] Special character in UI event not supporting all.

Post your questions and help other users.

Moderator: Martin

Post Reply
MohitBariya
Posts: 15
Joined: 28 Apr 2017 15:29

[Solved] Special character in UI event not supporting all.

Post by MohitBariya » 22 Aug 2017 14:05

Hi martin.
I want to create a flow which enters all required field during first email setup of my exchange account.
So i have used control UI action to enter id password and user name in required field of email setup.
But Getting/problem with Control UI.

I have created a contol ui with following code.

Code: Select all

setText2("username", "sro.in\mohitbariya");
But during execution, it paste on sro.inmohitbariya
Is "\" not supporting in Control UI? Or it is bug??
Last edited by MohitBariya on 22 Aug 2017 16:56, edited 1 time in total.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Special character in UI event not supporting all.

Post by Desmanto » 22 Aug 2017 15:04

\ (backslash) is special character, should be escaped when put inside quote/double quote. (in fact, it is the one who escape other special character)
To escape backslash, just type it twice. Your script should be

Code: Select all

setText2("username", "sro.in\\mohitbariya");
It happens in all script, not just Control UI, when the backslash is inside quote/double quote.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

MohitBariya
Posts: 15
Joined: 28 Apr 2017 15:29

Re: Special character in UI event not supporting all.

Post by MohitBariya » 22 Aug 2017 16:55

Desmanto wrote:\ (backslash) is special character, should be escaped when put inside quote/double quote. (in fact, it is the one who escape other special character)
To escape backslash, just type it twice. Your script should be

Code: Select all

setText2("username", "sro.in\\mohitbariya");
It happens in all script, not just Control UI, when the backslash is inside quote/double quote.
Thanks. It worked.

MohitBariya
Posts: 15
Joined: 28 Apr 2017 15:29

Re: [Solved] Special character in UI event not supporting al

Post by MohitBariya » 23 Aug 2017 07:52

@Desmanto
Need help for another control ui element.

I want to auto fill details during new email account configuration.
But gmail exchange not getting auto text input.

I have tried following
SetText2("", "abc@eol.com")
SetText2(0,0,"abc@eol.com")
SetText2ById("Add your email account","abc@eol.com").

Non of above worked.

[img]
Screenshot_20170823-131552.png
Screenshot_20170823-131552.png (98.79 KiB) Viewed 20393 times
[/img]

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: [Solved] Special character in UI event not supporting al

Post by Desmanto » 23 Aug 2017 08:21

Do you create the account directly from gmail app? @eol.com is microsoft exchange account?

I tried create new account in gmail, the elementid should not be blank or something like your. If I choose google account, the email field is
setText2ById("identifierId", "a@gmail.com");

While if I choose exchange and office 365 or other, the email field is
setText2ById("com.google.android.gm:id/account_email", "abc@eol.com");

Both of this works at my gmail app - settings - add account.

It seems you tap at the wrong element, that's why you don't have the proper Id. Try to type something at the email field, so it has some text that you can tap. Then use overlay again to tap it, you should see your text at the element you want to use.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

MohitBariya
Posts: 15
Joined: 28 Apr 2017 15:29

Re: [Solved] Special character in UI event not supporting al

Post by MohitBariya » 23 Aug 2017 17:34

Desmanto wrote:
It seems you tap at the wrong element, that's why you don't have the proper Id. Try to type something at the email field, so it has some text that you can tap. Then use overlay again to tap it, you should see your text at the element you want to use.
Will you please explain it again??
How to use overlay to detect element id??
Sorry for noob question.
And thanks you element id worked. But now want elementid for Password field.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: [Solved] Special character in UI event not supporting al

Post by Desmanto » 23 Aug 2017 17:50

Overlay is the Show overlay Control button.
Image

When you tap it, there will be two red button at the top of your screen : Info and Close. Then you can go to the app that you want (these 2 button will still there), to the place you want to control and tap the info to show the green box layout where you can choose the element.

So, that means until so far you have been guessing the elementId :shock: No wonder you choose the wrong element :) That's allright, we really lack tutorial for this Control UI and UI Event. Maybe I need to find some time to create a simple tutorial for this.

Try it now, keep the red button there, and continue until the password. Tap the info and tap the Password field. You should see the choice, and choose the one that has setText2ById(), tap it and the script will copied to the clipboard. You can go back to automagic and paste the script there. Change the text to your password. Those 2 scripts above also done using this way. So i also don't memorize the whole thing, automagic does it all for me :) That's why I love the Control UI.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply