Page 1 of 1

Count down

Posted: Mar 12th, ’20, 21:08
by Captionist
Is there a way to do a countdown, I need to post an announcement often like:

Announcement: We are having [event] at 18:00 (xx minutes from now)

I would like to have the (xx minutes ....) generated automatically

Any ideas / help will be appreciated

Re: Count down

Posted: Mar 13th, ’20, 12:51
by Tom
Type: Command

%INPUT__EventTime%%CODE_TimeDifference%

First macro is a Manual Text Input (__EventTime), note a "_" no output prefix. Must be in HH:MM format.
The second macro is Insert Command Code with the following code:

Code: Select all

Time := INPUT__EventTime
FTime := A_YYYY A_MM A_DD RegExReplace(Time, "\D") "00"

EnvSub, Minutes, FTime, minutes
Minutes:=abs(Minutes)

Send, % "Announcement: We are having [event] at " Time " (" Minutes " minutes from now)"