text matching is not triggered

Post your questions and help other users.

Moderator: Martin

rubaboo
Posts: 10
Joined: 20 Oct 2019 19:50

text matching is not triggered

Post by rubaboo » 20 Oct 2019 20:19

Hi there. Just started using this, although bought it years ago. Surprised to see flows animated if they are on screen and triggered. Very nice. Now to my question:
I made a trigger UI Event - Window Opened, specified a package name, and entered the appropriate text under "contains text". The trigger does not fire. To test, I replaced "contains text" with "matches glob" with the glob being a star character, then it worked. So apparently I chose the package name correctly, but don't know something about "contains text". I entered (and re-checked spelling a few times) two sentences from the dialog that pops up. The dialog has a header "Attention", then the two sentences that I entered, then some more text. Why is it not matching? Tried checking "Remove non-printable characters", did not help.

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

Re: text matching is not triggered

Post by Martin » 21 Oct 2019 20:43

Hi,

Contains text checks that the text matches exactly. Maybe there's some kind of white space issue, a line break or some other strange edge case.
Could you please add an action Write to Log with {text} to the flow with the trigger configuration that works for this dialog and then send the log to me and also the text you want to test in the trigger (menu->Log, menu->Send Log)?

Thanks & Regards,
Martin

rubaboo
Posts: 10
Joined: 20 Oct 2019 19:50

Re: text matching is not triggered

Post by rubaboo » 23 Oct 2019 05:14

Added the Write as you suggested. The logged text is just two words - "MTP application", without quotes. But the dialog I'm trying to catch is https://images.app.goo.gl/PY24viChNDvMFz2N6.
PM'd you the log and the flow.

rubaboo
Posts: 10
Joined: 20 Oct 2019 19:50

Re: text matching is not triggered

Post by rubaboo » 25 Oct 2019 07:06

Maybe I just need to add some delays? How do I do that?
Because I've tried it again, and noticed two things different this time:
1. The text was "Attention".
2. The dialog did not disappear, although the log shows start and end of click('OK')

rubaboo
Posts: 10
Joined: 20 Oct 2019 19:50

Re: text matching is not triggered

Post by rubaboo » 25 Oct 2019 07:51

Also, if the phone is locked, click('OK') doesn't work. When I unlock the phone, the dialog is still there. The log shows the flow was executed.

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

Re: text matching is not triggered

Post by Martin » 25 Oct 2019 19:21

Hi,

Thanks for the log.

It looks like the dialog just contains the text "MTP application" for some reason. Maybe Samsung classified the text as "Secure" which means that another application like Automagic can not detect the text at all. Another possibility might be that the dialog is initially shown with "MTP application" but then the content of the dialog is modified to "Attention...".

You could try to use a very short sleep (maybe it's not even required) but then use an action 'Control UI' with function 'text = getTextInActiveWindow()' to see if it's the dialog you are looking for.

It sounds like you want to click OK when the device is locked. This will not work since the device has to be unlocked first to click the button. You can only interact with the elements that are actually visible on screen.

Regards,
Martin

vertigo
Posts: 147
Joined: 28 Oct 2018 00:28

Re: text matching is not triggered

Post by vertigo » 05 May 2020 18:48

As discussed in another thread starting here, myself and Desmanto have run into this issue as well.

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

Re: text matching is not triggered

Post by Desmanto » 07 May 2020 15:03

@Martin : As discussed in the link above, I can't reproduce the UI Event Recent event (contains text : Flow already exists). I have tried with various keyword, and it still doesn't get detected properly. The UI event only detect the word "Flow" in Automagic, despite a lot of other wording.

The only way to let the UI Event - Window opened works, is usually leave the contains text field blank, so it detect everything. But this cause the flow to trigger so often, and we need to filter the word afterward using regex. This works, but create unnecessary resource hog while we are using Automagic.

Combined with the original problem in this thread, it seems that the issue is not limited to Automagic only, but other apps too.
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.

User avatar
Hit
Posts: 91
Joined: 20 Jan 2020 11:31

Re: text matching is not triggered

Post by Hit » 13 May 2020 10:34

As I know : <Trigger Window opened> with <text contains> ((must be defined))
  • react to the <Window label>
  • not react to the <Texts it contains>
  • the <Variable t͟e͟x͟t͟> trigger Supplied is the label of that window
So is there anything shady here?

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

Re: text matching is not triggered

Post by Desmanto » 13 May 2020 17:07

@Hit : That make sense, it is the title window's text. However I am curious why I can get "Flow already exists" from the Recent event (I don't type that, I select from the Recent). So maybe I just got it by accident.
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