How to Run a Macro Weekly and when the Mac is Unlocked

Hey Adrian,

@Nige_S is right. You can't chain the triggers.

To answer your question more specifically we need for you to be more specific about your requirements.

Thinking out loud here...

I'm guessing what you want is to run your macro on Sunday @ 08:30 (or after) when your Mac is unlocked.

If so then you'll need a macro with an Unlock Trigger:

  • Activate on Unlocking the Mac
  • Poll the day and time
    • If in the right ballpark
      • IF macro has not run already
        • Run the body of the macro

Maybe store the last day the macro was run in a global variable to prevent it from running more than once:

Day of the month:

DAY()

Here's the day of the week calculation:

DOW(NOW()) = 7

Hour:

HOUR(NOW()) >= 8

Minute:

MINUTE(NOW()) >= 30

Oh, well – here's a full scale example:

Unlocked on Sunday @ 08-30 v1.00.kmmacros (13 KB)

Display-Macro-Image

Keyboard Maestro Export

-Chris

3 Likes