I've written a simplistic flow to flash the LED on my Nexus 6 (Flashlight On / Sleep 1s / Flashlight Off).
I would like to call this flow from within a loop in a script - the script would take the number of flashes as a parameter, and use the loop to call the flow that number of times (so I could, for example, get the LED to flash 5 times if a particular event occurred).
I've not tried writing any scripts in Automagic before, and I can't see how to call a flow from within a While loop. Any assistance appreciated.
(Also interested in any better ways to achieve what I'm trying to do, but this is primarily a learning exercise for me...)
Can I run a flow from within a script?
Moderator: Martin
Can I run a flow from within a script?
--
Philip
Philip
Re: Can I run a flow from within a script?
I love and prefer these commands too. Ability to Execuse/Stop/Enable/Disable Flows in the script.
Re: Can I run a flow from within a script?
Hi,
Scripts can not execute/stop/enable/disable flows. Scripts are mostly meant to modify variables but not to completely replace regular actions.
Regards,
Martin
Scripts can not execute/stop/enable/disable flows. Scripts are mostly meant to modify variables but not to completely replace regular actions.
Regards,
Martin
Re: Can I run a flow from within a script?
Thanks, Martin.
So to achieve my aim, I need to explicitly code the For/While loop within my flow (e.g. use an Action to set a counter to zero, then test its value in a Condition, use an Action to increment it within the loop and then go back to the Condition until it reaches its final value)?
So to achieve my aim, I need to explicitly code the For/While loop within my flow (e.g. use an Action to set a counter to zero, then test its value in a Condition, use an Action to increment it within the loop and then go back to the Condition until it reaches its final value)?
--
Philip
Philip
Re: Can I run a flow from within a script?
Yes, that's the way. You can also check out an example like 'Countdown' in the Menu->Catalog in section 'Scripting'.
Regards,
Martin
Regards,
Martin