Timed Macro Not Running

Is there some reason you do not just put the Mac to sleep, which will automatically require a sign-in when it is woke?

You can put to sleep via a KM Macro if you wish:

I have a fairly complex macro which does orderly close of all of my apps, and then puts the Mac to sleep.

Long story short: My Mac doesn’t auto-sleep because of VLC being paused (not stopped) in the BG. So I have a custom Keyboard Maestro macro that does some checking to see if everything else has been idle for X period of time, and IF yes, it uses the Put Computer to Sleep action you mentioned.

So this is really about Keyboard Maestro being able to continue doing that with the lock screen ON, which I plan on invoking manually.

But my first step was to reduce the action down to just the periodic check trigger + Put Computer to Sleep and it still didn’t work. (Hence the question)

Does this make more sense?

It sounds like we’re going the same direction but on different tracks :slight_smile:


6 posts were split to a new topic: How Do I prevent my Mac from sleeping while the KM macro is running


I believe that I've got this issue resolved. In tinkering with an AppleScript (the basis of which I found on StackExchange) I found that when placed at the beginning of the macro it will successfully unlock the screen.

Note that you should run the macro manually a couple of times before relying on the script because you may have to give permission to a couple of services in the Security & Privacy Preferences pane to allow the script to control it. Replace the "YourPasswordHere" with the password that unlocks your screen/Mac:


This will unlock the Mac and allow you to proceed with the remainder of the automation as programmed into KM.