Pause Until: Pointer Is Not Spinning Beach Ball

I want to be able to 'Pause Until Pointer Is Not Spinning Beach Ball'. Is this possible with existing tools?

It depends what you mean by "existing tools". There is a macOS command called screencapture which has a parameter called -C which lets you capture the cursor (now I'm assuming that cursor means pointer here, but I'm not sure. Most people confuse those two words. Technically the cursor is the flashing text bar while the pointer is the mouse icon. What you want is to capture the mouse icon. I just gave it a test and it DOES capture the pointer.) If you search the captured image, instead of the screen, for the spinning ball, then YES you can actually achieve this. Have I pointed you (no pun intended) in the right direction, or do you need help writing this macro?

Keep in mind that the user can hold the pointer on the edge of the screen which means only a HALF/QUARTER of the spinning ball may be visible. This will complicate the macro quite a bit (if you want to account for this.) Also, do you need to account for multi-monitor setups?

1 Like

Hey @peternlewis,

It Looks like Keyboard Maestro's own Screen Capture action does not have the option to capture the cursor.

Am I missing something?

If not then please consider adding the option.

Given this thread's task – it would be possible to capture the area around the cursor and not have to search the whole screen.


If we had the ability to create/define our own actions, we could do this without Peter's involvement. Maybe KM 11? :grinning: :grinning:

There is no apparent API to screen capture with the cursor.

I suspect the screencapture utility uses some private undocumented flag to include the cursor, or alternatively maybe it uses some other API entirely.

You can already make your own plugin actions. Good luck with that though, read this article for an interesting discussion on some of the things that have to be done to reimplement screencapture:

It's amusing too because some of those things are the things that go on in the Prompt for Screen Rectangle action, and I'd love to have access to some of those private APIs for controlling the cursor.

1 Like

I always appreciate/treasure your replies, even when I'm proven wrong or embarrassed but the fact that I didn't know something about KM (like plugin actions, which I obviously need to read up on.) And when I read the article you cited, I learned that you can hold down the space bar while taking a screen shot in macOS. That's quite a revelation, although I'm not sure I will need that very often.

1 Like

Soooo....? No?

I told you one way to do it with screencapture. I actually said "YES" in capital letters. I tested it and it worked for capturing a pointer. I presume the spinning ball pointer will also be captured, but I couldn't generate a spinning ball because I have an M1 Mac which is so fast it disproves Kurt Godel's incompleteness theorem. :wink: (The part about Godel was sarcasm.)

Or are you wanting KM to be able to do it with an action? Peter said KM can't because there's no API to do that. In my opinion, he doesn't need to use an API function because, in my opinion, shell commands are supported API interfaces. But it's his choice. Yet he'll probably chime in here and tell me why I'm wrong.

I did point out to you a couple of problems with my solution that you didn't answer. E.g., I asked you if you are worried about what happens if the user moves the mouse off-screen and then you can see only half or a quarter of the spinning ball. You didn't answer. Does that mean you don't like my solution?

Perhaps what you want to know is whether an app is "not responding" or not. The spinning ball is not the only way to detect that. But that's the way you worded your question. If I have correctly described what you want, I think there's a long thread about this topic, but I couldn't find it right now. Is that what you are really after?

OK, sounds good, the screen capture with the pointer will work. But I don't want to accumulate endless screencaptures.

And, yes, I just want to know whether the app is responding. However it seems to be a shell type app that doesn't register in the dock. It is the Streamdeck driver software.

When I do a backup it seems to hang with the spinning beachball, but eventually completes. So I have a macro that does the backup, but the spinning beach ball is not always the same time on screen, so I want to continue when it disappears.

I think you need to clarify a few things.

First, your paragraph #1 says you want to try the screen capture utility, but then in the same paragraph you say you don't want to "repeatedly" use screen captures, but you didn't state why not. To me, this is contradictory. Either you want to use screenshots, or you don't. (By the way, you never accumulate any screen captures in a folder, you just momentarily take screenshots then discard them.)

Second, your paragraph #1 says you want to use screen captures, but your paragraph #2 says you were interested in the other approach I mentioned was to detect if the app was "not responding" according to macOS, which is probably (but we'd have to test for your app) the same thing as detecting a spinning beach ball. There would be no screen shots involved in this, so you can be happy about that.

Thirdly, your original post implies that you wanted to "Pause Until Pointer Is Not Spinning Beach Ball" but based on the wording in your last post what you stated was that you want to do is detect "whether the app is responding". These are different things. Which one do you want? In your first statement, you are already assuming that the beach ball exists. In your second statement, you don't want to assume that, but you want to detect it.

Lastly, have you opened a ticket with StreamDeck to find out why the application does not respond? Have you googled this or checked their support site? Have you tried reinstalling the StreamDeck app? If you don't do these things, you could be wasting your time writing a macro.

Bonus: if the StreamDeck app is not responding, you may not even have to do any of the above! All you have to do is check if it's responding yourself! Just send a command to it. If it responds, it's responding, but if it doesn't, it isn't. In that case you don't have to check the screen or macOS.

I found one of the threads on this site that discusses your question. They didn't discuss your solution of checking the spinning beach ball, but at least one of the other solutions was discussed in this page.

First- I neither 'want' nor 'don't want' to use Screen Capture Utility. Any approach/solution that works is good.

Second- And, yes I am interested in the other approach as well. Again, any approach/solution.

Third- I equated the spinning beach ball with the app being unresponsive. So I f the spinning beach ball exists, then does not exist, the app would have become responsive after being unresponsive.

I am guessing that the app is slow to backup because I have three Streamdecks, about 30 profiles each, with many with multiple pages. I think it's just taking time.

So... any approach that works is good with me.

If detecting the spinning beach ball with a screenshot works (I assume this means taking screenshots every few seconds, so as long as I can trash them as it goes), great.

If testing for the app being responsive some other way works, great.

But I don't know how to do either one.

Okay, those are good clarifications. I think this has been discussed before, more than once, and the thread I cited above was one of those discussions.

But I'm willing to take a stab it it today. The only problem I have is that I have to find a way to test it, by finding an app that's "not responding". Can you think of any built-in macOS app that I can force into a non-responding state?