Hi,
I want to click OK Button as soon as this popup is displayed after every call or data usage and also want to store this text in an file (Just like Balance Update / USSD blocker by Sriram Melkote Tools app available in the Google Play Store)........
Please Help!!
Click and store text
Moderator: Martin
Click and store text
- Attachments
-
- Screenshot_2015-08-05-11-39-34.jpg (410.36 KiB) Viewed 14069 times
Re: Click and store text
Hi,
You could use trigger UI Event to detect this window and then use Control UI with functions text = getText(x, y); to extract the text and click("OK"); to dismiss the dialog (function back(); might also work).
Regards,
Martin
You could use trigger UI Event to detect this window and then use Control UI with functions text = getText(x, y); to extract the text and click("OK"); to dismiss the dialog (function back(); might also work).
Regards,
Martin
Re: Click and store text
Hi Martin
What will be the event type and package name in control UI ??
What will be the event type and package name in control UI ??
Re: Click and store text
Hi,
Hard to say, maybe com.android.systemui but I'm really not sure.
You could use trigger UI Event and set the package to * to react to all packages and then check the log of Automagic.
I would not use condition Debug Dialog in this particular case since it could lead to some kind of endless loop when showing the Debug Dialog also triggers the flow again.
Regards,
Martin
Hard to say, maybe com.android.systemui but I'm really not sure.
You could use trigger UI Event and set the package to * to react to all packages and then check the log of Automagic.
I would not use condition Debug Dialog in this particular case since it could lead to some kind of endless loop when showing the Debug Dialog also triggers the flow again.
Regards,
Martin
Re: Click and store text
Hi,
I have been able to trigger the flow when the popup is displayed but it is also triggering the flow when the phone call is connected after making the phone call
http://automagic4android.com/flow.php?i ... e9c6b1908a
I have been able to trigger the flow when the popup is displayed but it is also triggering the flow when the phone call is connected after making the phone call
http://automagic4android.com/flow.php?i ... e9c6b1908a
Re: Click and store text
Hi,
You could either change the trigger to match the contents of the dialog by setting the type to matches glob with *Session Cost* (only works when the UI event contains the whole text and not just the title).
You could also execute the action Control UI and check if the extracted text contains the pattern you like. You can do this with a condition Expression: contains(text, "Session Cost");. You also have to change the action Control UI to use the actual coordinates of the text field instead of variables x and y.
Regards,
Martin
You could either change the trigger to match the contents of the dialog by setting the type to matches glob with *Session Cost* (only works when the UI event contains the whole text and not just the title).
You could also execute the action Control UI and check if the extracted text contains the pattern you like. You can do this with a condition Expression: contains(text, "Session Cost");. You also have to change the action Control UI to use the actual coordinates of the text field instead of variables x and y.
Regards,
Martin
Re: Click and store text
Hi Martin
When I changed contains text to matches glob, it is not triggering the flow.......
http://automagic4android.com/flow.php?i ... 259f038e97
When I changed contains text to matches glob, it is not triggering the flow.......
http://automagic4android.com/flow.php?i ... 259f038e97
Re: Click and store text
Hi,
Did contains text work? Can you enable the flow, display the dialog and check what's in the log? I assume that the variable text in this case only contains the title Phone but not the content of the entire dialog.
If this is the case, you could set contains text to Phone and then query the text with action Control UI: dialog_text = getText(200, 650); to extract and then check the text with Expression: contains(dialog_text, "Session Cost");.
You can find the real coordinates of the text either with Control UI/Show Overlay Control or by enabling System settings->Developer options->Pointer location.
Regards,
Martin
Did contains text work? Can you enable the flow, display the dialog and check what's in the log? I assume that the variable text in this case only contains the title Phone but not the content of the entire dialog.
If this is the case, you could set contains text to Phone and then query the text with action Control UI: dialog_text = getText(200, 650); to extract and then check the text with Expression: contains(dialog_text, "Session Cost");.
You can find the real coordinates of the text either with Control UI/Show Overlay Control or by enabling System settings->Developer options->Pointer location.
Regards,
Martin