Page 1 of 1

Text display action

Posted: 22 Aug 2017 19:49
by TheUnknownBuffalo
Hi all

Is it possible for AM to action based on monitoring text displayed within an app?

As in, say an app displays text 'you won a prize' in the middle of the screen but it isn't a button or a dialog box?

Re: Text display action

Posted: 23 Aug 2017 05:08
by Desmanto
It can probably done using the same solution to your previous question.
http://automagic4android.com/forum/view ... f=5&t=6854

But I think in this case you mean the toast message, white text on gray background. If that so, you can use trigger : Notification on Screen Displayed.
Package Name : *
Text Filter : contains text :
(text filter is blank, no need to fill anything)

Single asterisk (*), means it matches all apps. If you want only in selected app, select your app in the package name field, you can choose several at once.

Then you can choose what to do with the toast message. I use this to catch all toast message from all apps and log it to file for further research.

Re: Text display action

Posted: 24 Aug 2017 09:42
by TheUnknownBuffalo
Ops sorry, was on holiday and din't realise I double posted!

I've used the overlay function to find the text object, and now have a:

text = getText("Congratulations*");

and have added it to a trigger of a UI announcement:

event type: accouncement
package name: *
text, contains text: Congratulations

then I have it follow through with a notification on screen: test to check that it works

When I run it through AM, it displays 'test' straight away, so I enable the workflow, yet it doesn't work. Do I need to add some kind of condition when text displayed for it to run?

Re: Text display action

Posted: 24 Aug 2017 13:34
by Desmanto
Show Overlay Control from Action Control UI is different compared to Recent Events from Trigger UI Event. One is for action, executing something; while the trigger is detecting UI Event. You should open trigger UI Event, leave that open, go to the app; do not use show overlay. Just like the instruction in the thread before. Automagic will automagically fill the value for you. You just need to select the correct recent event.

If you can select the the element, means it is not toast message. It is correct already to use trigger : UI event, to detect it. Manual execution from AM will always run all your action/condition without actually get triggered by the real event. It is for testing the action/condition, not the trigger.

Re: Text display action

Posted: 24 Aug 2017 18:03
by TheUnknownBuffalo
hmm when I do that, I can't see anything about recent events in the trigger, here should I be looking?

Re: Text display action

Posted: 25 Aug 2017 01:10
by Desmanto
Can you show me the screenshot when the "Congratulations ..." appear? I am confused now whether it is toast message or element at the UI. What is the color of the message? White text on gray box? Or some other color?

If it is toast message, then my answer in 2nd post can catch it. If it is element, then 4th post or previous thread can catch it.