Page 5 of 7

Re: EAP version 1.29.0-dev

Posted: 18 Sep 2015 10:05
by lchiocca
Just wanted to let you know that everything looks good :). I've been using it for a couple of days and haven't encountered anything unusual.

Re: EAP version 1.29.0-dev

Posted: 22 Sep 2015 14:11
by Martin
Good to know that it works now. I hope CM does not change the profile-features in the near future :-)

Re: EAP version 1.29.0-dev

Posted: 22 Sep 2015 14:14
by Martin
This version is considered feature complete. I will concentrate on testing and bug fixing in the next time.

Changes in this update:
  • new trigger Send/Share Multiple Intent Received
  • new action Remove WiFi Access Point
  • added more inbox types to trigger/condition Gmail Unread Conversation Count
  • added helper to test regular expressions in action Script
  • fixed actions Set GPS State and Set Network Location State on Android 6
  • minor changes and fixes
Download: Automagic.apk (2015-09-22)

Re: EAP version 1.29.0-dev

Posted: 29 Sep 2015 08:59
by natong
Martin wrote:
  • added support for break, continue and return in scripts
Now, we can exit the script block and continue on the next block ? and/or exit flow by a script command?

Re: EAP version 1.29.0-dev

Posted: 29 Sep 2015 13:31
by Martin
The new statements only have effect within an action Script, but don't allow to stop a entire flow immediately. You could use a condition Expression and end the flow on true/false when the rest of the flow should not be executed.

break: is used to stop evaluating expressions in the loop body and continue the script with the first expression after the loop
continue: is used to stop evaluating expressions within the loop body and to continue with the next iteration of the loop
return: ends the current script and returns the specified value

Regards,
Marti

Re: EAP version 1.29.0-dev

Posted: 03 Oct 2015 13:18
by Martin
A new EAP build is available.

Changes in this update:
  • minor changes and fixes
Download: Automagic.apk (2015-10-03)

Re: EAP version 1.29.0-dev

Posted: 05 Oct 2015 19:33
by gollyzila
Hi Martin,

I'm trying to show a notification on my Moto 360 (with Notification on Statusbar) but it will not display on the watch if either "Ongoing" or "Keep on clear" setting is selected. I need this because I'm making a School profile for my phone that I want to be able to enable and disable from my watch.

Re: EAP version 1.29.0-dev

Posted: 06 Oct 2015 14:37
by Martin
This is a limitation of Android Wear, which will not show ongoing notifications posted on the phone. You either have to disable the "Ongoing" and "Keep on clear" flags or alternatively use a custom widget and show the widget on the wear device with Show Custom Widget Overlay (Android Wear). I think I could add a feature to post notifications directly on Android Wear which would probably also work for ongoing notifications. I'll add it to the todo-list.

Regards,
Martin

Re: EAP version 1.29.0-dev

Posted: 08 Oct 2015 10:47
by poosterl
Hi Martin,

I wonder how I should use "return" in a script.
"return" is normally used to return a value form within functions.
Since (as far as I know) functions cannot be defined in an automagic script, I can only assume that "return" should be used at script level.
But how can a subsequent flow action access the value returned from the script then?

Tx in advance for your reply,

Peter.
Martin wrote:The new statements only have effect within an action Script, but don't allow to stop a entire flow immediately. You could use a condition Expression and end the flow on true/false when the rest of the flow should not be executed.

break: is used to stop evaluating expressions in the loop body and continue the script with the first expression after the loop
continue: is used to stop evaluating expressions within the loop body and to continue with the next iteration of the loop
return: ends the current script and returns the specified value

Regards,
Marti

Re: EAP version 1.29.0-dev

Posted: 08 Oct 2015 18:13
by Martin
You can use return to terminate a script early, without returning a value, but you could also use it in a condition Expression to return a boolean value, for example to return false when some preconditions are not met.

Code: Select all

if (var==null) {
  return false;
}

return var>5;
You could also use it to create something like functions with eval, admittedly quite a hack:

Code: Select all

xyz = eval("if (var==null) return false; return var>5;");
Regards,
Martin