-
Notifications
You must be signed in to change notification settings - Fork 121
/
EggTimer.ahk
28 lines (25 loc) · 940 Bytes
/
EggTimer.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include FcnLib.ahk
timeToWait := prompt("How long would you like to set the timer for (in minutes)?`nOr, enter a timestamp if you want to be reminded later today... (like 17-23-00)")
msg := prompt("What message would you like to display?")
if (timeToWait=="")
return
if RegExMatch(timeToWait, "^\d\d-\d\d-\d\d$")
{
date := CurrentTime("hyphendate")
time := DeFormatTime( date . "_" . timeToWait )
}
else if RegExMatch(timeToWait, "^\d\d-\d\d$")
{
date := CurrentTime("hyphendate")
time := DeFormatTime( date . "_" . timeToWait . "-00" )
}
else if RegExMatch(timeToWait, "^\d+$")
{
;if just a number, add that number to present time
time:=AddDatetime(CurrentTime(), timeToWait, "minutes")
}
else
errord("unsupported time", timeToWait, A_ScriptName, A_LineNumber)
filename=scheduled/%A_ComputerName%/%time%.ahk
text=MsgBox Hotkey Timer!!! Ring, ring!``n%msg%
FileAppend(text, filename)