disabled flows list
Moderator: Martin
disabled flows list
hi
list=newList(getFlowNames());
with this script I am getting all flows list. I want to get only disabled flows list. Is there any solution? because I want to enable those flows with shortcut.
thanks from record4
list=newList(getFlowNames());
with this script I am getting all flows list. I want to get only disabled flows list. Is there any solution? because I want to enable those flows with shortcut.
thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: disabled flows list
It is very dangerous to enable a lot of flows at once, unless you already know the exact usage of all of them. Currently there is no direct way to get the state of all flows. You can loop check using condition to the list of flows you get from getFlowNames(). But that is very slow.
I create my own method to init the flows.xml, using regex to find all the flow names including all of their attributes. Using the same method, we can retrieve the flows state and save it to certain glovar. We can also only get the list of enabled flows or disabled flows. The flow and script is quite long, seems to be too hassle for your usage case.
I create my own method to init the flows.xml, using regex to find all the flow names including all of their attributes. Using the same method, we can retrieve the flows state and save it to certain glovar. We can also only get the list of enabled flows or disabled flows. The flow and script is quite long, seems to be too hassle for your usage case.
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: disabled flows list
Hi Desmanto
Trigger =notification on Statusbar displayed
Action= script
a=getFlowNames()
Condition = if notification contains any flow names execute that flow.
How can use it in this way? Because I want to use some time trigger flows using global variable date and time using shortcut.
From record4
Trigger =notification on Statusbar displayed
Action= script
a=getFlowNames()
Condition = if notification contains any flow names execute that flow.
How can use it in this way? Because I want to use some time trigger flows using global variable date and time using shortcut.
From record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: disabled flows list
Hi, (not Desmanto) but thought I'd weigh in...
How about just create a small file (or even hard code the list in the script) that contained a table of:
Since you must have written the script to deal with the notification you would just add the trigger word and flow name to the list.
Then you can just see if there's a match in the list and call the assoc. flow.
Perhaps I missed something in your purpose though.
How about just create a small file (or even hard code the list in the script) that contained a table of:
Code: Select all
notification trigger word, flow name
notification trigger word, flow name
notification trigger word, flow name...
Then you can just see if there's a match in the list and call the assoc. flow.
Perhaps I missed something in your purpose though.
Re: disabled flows list
Hi Canadadry
Where can I found the word "weigh" in automagic premium?
From record4
Where can I found the word "weigh" in automagic premium?
From record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: disabled flows list
@Rafi4 : I am also no very clear about your main purpose. If you need to execute flow based on the notification text, why don't simply put the {notification_text} in the execute flow?
Of course, if you need to crosscheck first if the flow exists, you can use the getFlowNames() and only continue to execute flow if the flow exists.
Of course, if you need to crosscheck first if the flow exists, you can use the getFlowNames() and only continue to execute flow if the flow exists.
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: disabled flows list
Hi Desmanto
Flow name is for example "Test on"
If notification text contains "Test on" go to true Execute the flow "Test on" if doesn't contains go to false
From record4
Flow name is for example "Test on"
If notification text contains "Test on" go to true Execute the flow "Test on" if doesn't contains go to false
From record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: disabled flows list
Does the notification contains "Test on" as in "Test on can be executed", or just "Test on" without any extra wording?
If just "Test on", then it is much easier, simply use
True, execute flow {notification_text}, false do nothing.
But if the text only contains and can have longer wording, you should loop the flownames
Same, true execute flows {i}, false do nothing.
But be careful for the exact wording. Because if you have flow's name as "on can", this will execute that flow too. So you have to make sure the word doesn't contain any other flow than the one you need. It is better to limit the text to a certain pattern, so you never mis trigger any wrong flow. You can still use regex or just a simple startsWith() or endsWith() to get the flow name correctly.
If just "Test on", then it is much easier, simply use
Code: Select all
containsElement(getFlowNames(), notification_text)
But if the text only contains and can have longer wording, you should loop the flownames
Code: Select all
for(i in getFlowNames()
{
if(contains(notification_text, i))
return true;
}
return false;
But be careful for the exact wording. Because if you have flow's name as "on can", this will execute that flow too. So you have to make sure the word doesn't contain any other flow than the one you need. It is better to limit the text to a certain pattern, so you never mis trigger any wrong flow. You can still use regex or just a simple startsWith() or endsWith() to get the flow name correctly.
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: disabled flows list
Hi Desmanto
Working fine. But False going to execute last index of the flow.
For example
Flows list
Awake
Bubble
Cartoons
Test
if the notification_text doesn't contains any flow name it was executing the last flow "Test". How can I avoid this?
thanks from record4
Working fine. But False going to execute last index of the flow.
For example
Flows list
Awake
Bubble
Cartoons
Test
if the notification_text doesn't contains any flow name it was executing the last flow "Test". How can I avoid this?
thanks from record4
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1
Samsung Galaxy j2 non rooted.
Android 5.1.1
Re: disabled flows list
Where do you put my previous script, in a script or an expression? It should be expression. If you have put it into expression, only connect the true branch to the execute flow. Leave the false branch not connected. So when it loop until finished and found nothing, it will return false and the flow stopped there.
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.