Pause until not idle

I've used this macro in one form or another for years. Then I got a MacMini M4. I run macOS 15.2 on it. It works reliably on my other Macs, just not the new one. Any ideas?
Stop Screensaver when not idle.kmmacros (4.4 KB)

Your macro has no triggers, so I have no idea how you call this macro. Therefore, I don't understand how it works. But if you are trying to detect when a screen saver ends, there's a much easier way to do it... (I didn't test it, but I think it will work)

image

This should run until the screen saver ends.

Your macro says "screensaver programs will periodically check the state". Can you explain what you mean? As far as I know, screen saver programs do not check the state of a KM variable. So I'm unable to understand something important.

Correct. No triggers because it’s a very small part of a larger system to manage desktop wallpapers (in KM of course), including a screensaver I wrote.

It is a multi-threaded app. The problem is the interactions between the synchronous and the asynchronous invocations of the underlying macros changed the behavior with the MacMini M4, which as we all know is much faster than its predecessors. It was a timing bug in the end. Now solved.

1 Like