Function Repository Resource:

SetAlarm

Source Notebook

Set an alarm

Contributed by: Bob Sandheinrich

ResourceFunction["SetAlarm"][time]

sets an alarm to go off at the scheduled time.

ResourceFunction["SetAlarm"][alarm,time]

evaluates alarm at the specified time.

Details and Options

ResourceFunction["SetAlarm"][time] creates a dialog and plays audio of a church bell.
ResourceFunction["SetAlarm"]["string",time] uses the default alarm, inserting the string into the dialog.
The following time specifications can be given:
Quantity[]run after the specified amount of time
DateObject[]run at the specified time
The alarm is set in the current session. If the session is terminated, as with Quit, the alarm is canceled.
ResourceFunction["SetAlarm"] returns a TaskObject.

Examples

Basic Examples (1) 

Set an alarm to go off after five seconds:

In[1]:=
ResourceFunction["SetAlarm"][5]
Out[1]=

Scope (3) 

In one minute, beep:

In[2]:=
ResourceFunction["SetAlarm"][Beep[], Quantity[1, "Minutes"]]
Out[2]=

Include a message in the standard alarm:

In[3]:=
ResourceFunction["SetAlarm"]["Time to make the donuts", 5]
Out[3]=

Specify a time for the alarm:

In[4]:=
time = Now + Quantity[10, "Seconds"]
Out[4]=
In[5]:=
ResourceFunction["SetAlarm"][
 Speak["It is " <> TextString[time]], time]
Out[5]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 20 March 2019

License Information