Sleep Screen Action Fails on Mac Mini with Apple Silicon

The "sleep screen" action fails completely on my new Mac Mini, an Apple Silicon machine. The same macro worked on my 3-yr-old Intel Mac Mini. Both are Big Sur.

What's the problem? Has anyone else seen this happening?

(I disabled two actions in the macros while trying to debug; all of it worked two days ago on the older machine.)

Sleep.kmmacros (2.2 KB)
image

1 Like

Hey Bobby,

Open the Apple Script Editor.app, and run this script.

tell application "System Events"
   sleep
end tell

If it works then something is going on with Keyboard Maestro.

If it doesn't then Big Sur is acting up for sure.

-Chris

That works, the attached Macro works, and the "Put Computer to Sleep" action works, but "Sleep Screen" does not. Go figure.

Sleep.kmmacros (2.5 KB)

Yeah, I'm having the same problem (on a M1 Macbook Pro, 2020; OS 11.1)

"Put computer into sleep" and "sleep screen" are different things. Luckily, command line still works.

pmset displaysleepnow
1 Like

How can I apply your command line solution (pmset displaysleepnow) in a KM macro?

Just use "Execute shell script" action and put the command as script content.

Alfred’s sleep screen also fails. I wonder if they’re using the same method?

I finally got around to testing this. Screens sleep and within a second, they wake again.

Update. Before "sleep" I have two commands, to minimize all windows and go to the 1st virtual screen before sleeping the display. I added a 1.5 second pause after those commands, before "pmset displaysleepnow" ... and it works, now.

1 Like