text matching is not triggered

Post your questions and help other users.

Moderator: Martin

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

Re: text matching is not triggered

Post by Hit » 13 May 2020 17:13

Desmanto wrote:
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.
@Desmanto, because it log all type of event, not only the type we choosing. You should try to see the event type.

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

Re: text matching is not triggered

Post by Desmanto » 13 May 2020 18:10

Yes, it show everything. i purposely reimport the flow several time and immediately check the recent events (less than 2 seconds). It shows various event, including Window openend. But none contain the wording "Flow already exists". So i guess we can't detect it if the window title doesn't give unique naming. As Window title "Flow" is too generic inside Automagic.
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 21:21

Desmanto wrote:
13 May 2020 18:10
Yes, it show everything. i purposely reimport the flow several time and immediately check the recent events (less than 2 seconds). It shows various event, including Window openend. But none contain the wording "Flow already exists". So i guess we can't detect it if the window title doesn't give unique naming. As Window title "Flow" is too generic inside Automagic.
Just use this text you found: with
  • Option
    • matches glob
    OR
    • matches regex
I'm pretty sure you can get what you want because I don't think many window have the Title exactly named: Hope that I may helped.

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

Re: text matching is not triggered

Post by vertigo » 13 May 2020 23:05

Hit wrote:
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?
In that case, it seems misleading. Clearly the assumption based on the UI event > window opened trigger is that it uses the text in the window title, not the window's label. Even the help screen says "Window opened...variable text often contains the title of the window." To me and Desmanto, and I would assume many/most others, that would indicate that it's looking at the text in the window's title, not some behind-the-scenes label. So if that's not the case, a) it's misleading and should be reworded to be more clear, b) there should be a variable for the actual text in the window, and c) how do we get the window's label, since it isn't shown?

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

Re: text matching is not triggered

Post by Desmanto » 14 May 2020 10:12

@Hit : With keyword "Flow", it triggers at every flow opening, flow options and flow import. While it is not at all Automagic's windows, we still need to filter the result to show only flow import; which happen less frequently than others. Making the trigger have more false branch execution that the useful true branch one. It is usable, but create more overhead. It will be last solution if no other option available.

@vertigo : It is we misunderstand it.
a. Maybe Automagic still can make it clearer by labelling the Text as Window Title's Text.
b. To get the text on the active window, use CUI getTextInActiveWindow().
c. you can get the window title by using Recent events. Automagic already log the recent UI Event. You can also use debug dialog, check the variable text. Or you can log the whole trigger using my variable logger flow.
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 » 15 May 2020 00:15

I haven't don't really know the problem that you have but you can try another approach. Hope you find better solution.

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

Re: text matching is not triggered

Post by vertigo » 27 May 2020 08:41

Desmanto wrote:
14 May 2020 10:12
With keyword "Flow", it triggers at every flow opening, flow options and flow import. While it is not at all Automagic's windows, we still need to filter the result to show only flow import; which happen less frequently than others. Making the trigger have more false branch execution that the useful true branch one. It is usable, but create more overhead. It will be last solution if no other option available.
Even that won't work. In my testing, the UI event triggers repeatedly just by having a flow, any flow, open. It seems almost every Automagic window has text="Flow" and the event type "Window opened" acts more like "Window open," i.e. triggered by a window with the specified text being open, not by the action of opening it.

I'm not seeing any way of accomplishing this. I thought if there was a way to trigger when opening an xml file with Automagic that could work, but AFAICT there's not. Definitely up against a wall on this one.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: text matching is not triggered

Post by Rafi4 » 27 May 2020 10:14

Hi vertigo
What do you want to achieve? Are you seeking help for component clicked or window opened trigger? If component clicked here is an example


Trigger = ui event (component clicked)
select package name and Leave text field Empty
Condition = Use expression as below

From record4

Code: Select all

text_list = newList("Expansion","Lock","Store","Flows","Ui infos");
for (i in text_list)
{
if (matches(i,text))
return true 
}
return false
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

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

Re: text matching is not triggered

Post by vertigo » 28 May 2020 00:35

I'm trying to make a flow for importing flows when one already exists with the name of the imported one. Currently, Automagic just tells you one already exists then leaves it up to you to rename or delete that flow then go back and import the new one again. It's discussed in this thread. The problem is, the only way to trigger a flow to do this automatically would be to use the UI event "Window opened" but there's no way to specify the "Flow already exists" window that shows when trying to import a flow, since just about every screen in Automagic has the "text" variable "Flow," which seems to be a bug.

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

Re: text matching is not triggered

Post by Hit » 01 Jun 2020 01:35

Isn't it have an option Replace existing?

Post Reply