Countdown Using Keyboard Maestro’s Progress Bar

Howdy folks,

There are several countdown macros on the forum already, but I didn’t see any that make use of Keyboard Maestro’s progress bar action (though I might have just missed them if there are). This one uses that action to display the countdown, updating both the text and colored bar in real-time.

More details, screenshots and screen recordings are below. As usual, feel free to share any comments or suggestions, or to let me know if it doesn’t work for you.

-Chris

47)[MG-SUBRT] Show countdown using progress bar.kmmacros (20 KB)

CURRENT VERSION: 1.0.0 (Friday, July 28, 2023)

Version History

v1.0.0 Friday, July 28, 2023
Initial macro

Screen recordings (click to expand/collapse)

↓ Starting the countdown ↓
Starting the countdown

↓ Stopping the countdown early ↓
Stopping the countdown early

Macro screenshot (click to expand/collapse)

RELEASE NOTES, INSTRUCTIONS AND DISCLAIMER

Purpose of this macro (click to expand/collapse)

Display a countdown timer using Keyboard Maestro’s progress bar action

How this macro works (click to expand/collapse)

This macro first parses the %TriggerValue% token to extract the action (start or stop countdown) and duration (in seconds).
It then performs calculations to determine how many times the progress bar must be updated according to the supplied duration.
After that it loops the progress bar, performing calculations to format the time in HH:MM:SS format and updating both the bar and text until the countdown has finished.

How to configure this macro (click to expand/collapse)

No configuration necessary.

How to use this macro (click to expand/collapse)

Run it as an execute a macro action with the parameter and asynchronously options checked.
In the parameter field, insert the word “Start” or “Stop”, followed by how many seconds you want for the countdown.
If stopping, you do not need to supply the seconds portion.
Example: Start 300 (for starting a 5 minute countdown)
Example: Stop (for stopping any countdown)

Disclaimer (click to expand/collapse)

TL;DR: I built it and it works for me. You can share/modify it how you want. But don't blame me if it doesn’t work for you :laughing:

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

3 Likes

Beautiful - now if we could change the color of the window =), but really, nice macro and very useful for me, I've used others but I like this the best so far.

Is there somewhere to trigger a sound and/or a screen 'blink/blinking' at the end of the time?
Ah...
I could put something after the 'clear progress bar' in the sub-routine. Would you suggest any other place? That seems to make sense.

1 Like

Thanks for the kind words!

I didn’t add that capability as of yet, but I like the idea and may do that in the future.

That is likely the best place for that kind of feature to. :+1:t2:

Do you think using this timer is taxing the system at all?

I highly doubt it. The macro is not that complex, and even on my newer version (which consists of a calling macro and subroutine), running continuously I see no change to CPU usage in Activity Monitor when it’s running versus when it’s not running.

1 Like

Last suggestion, maybe a variable could be added in the title that could tell the user what the timer is for. So the title would show time remaining and then some text. Just a thought, bro no biggie.