Is there any way with scripting to pull the next alarm time information?
Is there any way with scripting to pull the next alarm time information? I want to store this as text on the screen. I don’t want to reinvent the wheel, I assume someone must have already done this? Thanks for your help.
One way would be to push the variable from tasker to LL periodically.
You may use a script based on this one:
LL.bindClass(“android.provider.Settings”);
var alarm = Settings.System.getString(LL. getContext(). getContentResolver(), Settings.System.NEXT_ALARM_FORMATTED);
Android.makeNewToast(alarm, true).show();
In order to display a value in a text item (a shortcut) you may set a script in its resume event and use something like this:
LL.bindClass(“android.provider.Settings”);
var alarm = Settings.System.getString(LL. getContext(). getContentResolver(), Settings.System.NEXT_ALARM_FORMATTED);
LL.getEvent().getItem().setLabel(alarm);
(original post here : https://plus.google.com/u/0/+WernYuenTan/posts/T6Qwmvh3A12)
+Pierre That is perfect, one tiny addition any chance you could provide and explain how I would add a image that displays/hides if an alarm is set. Many thanks, really appreciate it.
That is a much better solution, Pierre Hébert. Thank you.
There is a “visibility” binding (under “item properties”). You can configure a shortcut with the wanted image and hide the text, then use this binding with something like “alarm_text.length() > 0” (NEXT_ALARM_FORMATTED is an empty string if no alarm is set)