text matching is not triggered
Moderator: Martin
text matching is not triggered
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.
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.
Re: text matching is not triggered
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
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
Re: text matching is not triggered
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.
PM'd you the log and the flow.
Re: text matching is not triggered
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')
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')
Re: text matching is not triggered
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.
Re: text matching is not triggered
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
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
Re: text matching is not triggered
As discussed in another thread starting here, myself and Desmanto have run into this issue as well.
Re: text matching is not triggered
@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.
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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: text matching is not triggered
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
Re: text matching is not triggered
@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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.