After updating to macOS Seqouia the following macro doesn’t work anymore. The screen goes dark for a second and returns to the previous state then. Am I missing some system setting for Keyboard Maestro that needs to be turned on here?
I'm no expert, but I have two ideas that may help.
I recommend that you check the Engine log at the time the system "waked up." There's a chance that you had a macro running that "moved the mouse" or "pressed a key" which could cause the wakeup. The log file could help you find the culprit, if the culprit is a macro.
Alternatively, as an experiment, I recommend trying a "pause" action (1 second) before the "sleep screen" action. There's a small chance that might give you a better result.
I'm running Sequoia and can successfully sleep the screen, but as @Airy says, I need to use a pause before the Sleep action.
Then I made a very lucky, wild guess. I'm not entirely sure why that would work, but inserting pauses whenever there's an attempt to manipulate the macOS GUI is a wise thing to try.
Yeah, i figure it was because Keyboard maestro processes actions so quickly, the OS didn't get a chance to "finish" registering the hotkey before putting it to sleep so the hotkey interrupted the sleep. But i could totally be wrong!
The Sleep Display is (on recent Mac OS versions) the simple shell command:
/usr/bin/pmset displaysleepnow
So assuming the macro is running it is hard to see how that would fail.
This is odd. Adding a pause to the macro doesn't change anything. It is likely not related to KM, as
/usr/bin/pmset displaysleepnow
results in the same behaviour. There is no other KM macro running and nothing that should interfere with the screen activity.
Thanks for your help!
Did you validate that by checking the log file? You didn't explicitly say that you checked the log file.
The only thing I can think of is that you have some other third-party software running that really wants your screen to be awake. Can you disable any always-running third-party utilities and try the Terminal command again?
-rob.
Sounds like something is actively stopping the screen from sleeping.
I would start with a Restart (cuz, why not?). And then if that doesn't resolve it, maybe a Safe Boot, and then look at what software is installed?