Snooze Macro for a Specified Amount of Time

I am currently working on a Keyboard Maestro macro and could use some help with its implementation. I have a specific requirement that involves handling checkboxes and controlling prompts based on the selected options. Here's a breakdown of what I'm trying to achieve:

Checkbox Behavior:
If "Snooze_Entire_Day" is checked, I would like to avoid any prompts for the remainder of the day.
If "Morning_Snooze" is checked, no prompts should be shown until the evening.
If "Evening_Snooze" is checked, prompts should be skipped until the next day.

I have set up the macro to run every hour within specific time ranges. Additionally, I have incorporated an "If" statement to check the time difference between the current time and the last recorded time (stored in a variable).

I would greatly appreciate any guidance or suggestions on how to handle the checkboxes and achieve the desired behavior.

TIA

Download Macro(s): Snooze Macro.kmmacros (6.3 KB)

Macro Image

Keyboard Maestro Export

Macro Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System Information
  • macOS 13.3
  • Keyboard Maestro v10.2

In short:

  1. Have a Global variable that stores your "next prompt time" in the format yyyyMMddHHmm
  2. Start your macro with an "If" action that compares the Global to the text token %ICUDateTime%yyyyMMddHHmm% -- the current date and time in the same format. If the Global is greater than the token the macro should cancel (using those formats lets you do string comparisons rather than having to mess around with date and time comparisons)
  3. When you want a pause, set your Global to the appropriate "next run" time

It does look as though your first and third cases are identical -- both block any further prompts until the next day. So you only need "no prompts until tomorrow" and "no prompts until this evening".

For the first you can set your Global to %ICUDateTimePlus%1%Days%yyyyMMdd%0000 (the date for today plus 1 day, to which you then append the time 0000). For the second, assuming your evening starts at 6pm, it would be %ICUDateTime%yyyyMMdd%1800.

2 Likes