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.

5 Commentsto Is there any way with scripting to pull the next alarm time information?

  1. Chris Rico says:

    One way would be to push the variable from tasker to LL periodically.

  2. 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)

  3. +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.

  4. Chris Rico says:

    That is a much better solution, Pierre Hébert​. Thank you.

  5. 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)

Leave a Reply

Your email address will not be published. Required fields are marked *