Time triggers when the computer is turned off

I have a macro that I want to run at the start of each week—let's say Monday around 9:30. It doesn't matter exactly when.

I can set a time trigger for Monday at 9:30, of course. But occasionally my computer will be asleep at that time—there's no time when I can 100% guarantee that the computer will be on and KM will be running. In those cases, I want the macro to run whenever the computer is running next.

I can think of a few solutions: I could set a LastTimeRun variable and use a Wake trigger to have the macro check whether it's been run this week, or I could have a helper macro use AppleScript to reset the main macro's trigger time when necessary. But those seem complicated and I wonder if there's an easier way ... like, a trigger that runs "at 9:30 on Monday or whenever the computer wakes next," or something like that.

Am I missing something, or is this a situation that requires a fiddly solution?

Hi @gabrielroth,

I had pondered upon it before. I think your first method should not be too difficult.

  • Save the time of the next execution into a variable.
  • Create a macro, using system wake as trigger, check the current time with the time saved in the variable,
    • if the next execution time is in the future,
      • do nothing
    • else
      • execute the macro and save the next execution time to the variable.