Cannot Use Screen Capture

It keeps a history of what's been copied to the clipboard...

If you can't envision the utility of that then Google is your friend.

You know how to search the Keyboard Maestro Editor and/or the Keyboard Maestro Wiki?

image

image

Chris has shown you how to find the "beep" action -- it's a useful debugging tool because it gives an audible indication that the macro has run.

I'm not sure it has -- at least, not run without errors -- because your pictures above are not what the macro should produce. You should be getting the entire front window, not a portion of it. But if it isn't working you should get a Notification of the failure -- have you allowed Notifications from KM?

One thing to watch -- if you don't have a window open in the active app, the macro as written will fail, though you should get a Notification. Try adding the following action at the end of the macro:

image

That'll get you a dialog telling you with "OK" if the screen capture action was successful or the error if it wasn't.

By "switch windows", do you mean switch apps? Have you checked your group settings? If your macro is in a group that's only available in the KM Editor, it won't work in other apps.

Thanks for this.

Chris has shown you how to find the "beep" action -- it's a useful debugging tool because it gives an audible indication that the macro has run.

I'm not sure it has -- at least, not run without errors -- because your pictures above are not what the macro should produce. You should be getting the entire front window, not a portion of it. But if it isn't working you should get a Notification of the failure -- have you allowed Notifications from KM?

Thanks for mentioning this. I've enabled Notifications now and the Notification says "Action Failed. Notification" followed by "Display Text. Notification". Any ideas?

Also, I think the partial image only occurred because I clicked the gear icon in the top of the action and selected "Copy as image." Which I realize now just refers to that action and not the macro itself. Sorry for any confusion!

By "switch windows", do you mean switch apps? Have you checked your group settings? If your macro is in a group that's only available in the KM Editor, it won't work in other apps.

Yes, I meant "switch apps". The macro is in the Global Macro Group, so it should work on all settings.

Thanks, I did get a beep but the notification said it failed. If it helps, I had an issue with pasting before (on a macro that worked fine for years). The details are here if you think the background would help: Ctrl-V Doesn't Work for Macro Anymore, But Ctrl-B Does? - #15 by cozandeffect1

Sounds like your Notifications aren't quite right still. Change the "Display Text" action you added to "Display text in a window" (as above) and turn off the "Screen Capture" action's "Notify on Failure" option so that KM uses its own dialog rather than going through the OS Notifications system -- that might get you a proper error message from the "Screen Capture" action.

Thanks. I've done both and get this when I run the macro:

It works! I've no idea why that change would fix the macro, but it now pastes like I wanted. (Also, it shows up in the Clipboard History Switcher.)

Thank you SO much for your help, everyone!

... and for some reason it stopped working. It only worked once yesterday. And I haven't changed anything. Does anyone have any suggestions?

It still works when I select an area in the Screen Capture action. But it won't work when I select any other options (e.g. "the front window"). Weird.

Also, it only selects my desktop screen (instead of, say, a Chrome window).

Doesn't work how? Doesn't run, runs but doesn't copy anything, something else? Keep the "beep" and the Display Text actions in there so you know whether the macro has run and the result of the screen copy action.

What Group is it in, and what are the Group settings? How does it behave with Finder windows, can you copy "main screen", try using a Named Clipboard instead of the System Clipboard in case there's a problem there (or another macro/utility interacting with the clipboard).

This, like your "hot key not working" issue, is going to be peculiar to your system and your settings so you'll have to dig around a bit.

Thanks for asking.

  1. It runs but doesn't copy anything. The beep sounds, and the Display Text says "OK".

  2. It is in the Global Macro group. Available for all applications, windows, and always activated.

  3. No other Named clipboards work, either.

  4. I cannot copy "Main Screen" or any other options. The only one that works is the "Area".

  5. I disabled all other Macros and tried just this one. Same result.

Go into System Preferences/Settings -> Privacy & Security -> Screen Recording and toggle both Keyboard Maestro's and Keyboard Maestro Engine's setting off and on again.

Two things:

  1. The "Engine" isn't there. Just Keyboard Maestro.
  2. After I turned the Keyboard Maestro setting off and then on, it worked... once. And then it stopped working again. (I then toggled it again and it worked once again.) So not quite... but it's good to see progress!

P.S. It is working fine now on the Main Screen. But it still only works once on the Front Window.

1 Like

Add it. Click the "+" button, hit ⌘⇧G, paste in "/Applications/Keyboard Maestro/Contents/MacOS" (without the quotes) and hit the Return key. Select Keyboard Maestro Engine and click "OK".

1 Like

YESSSS! You solved it! That is fantastic, thank you!

Hi, thanks again for your help. The macro worked for a bit but now it's not working.

Interestingly, your action now shows the following error:

Screen Capture failed to capture screen with error failed to capture front window

Do you have any suggestions?

If it helps, here's what I've tried:

Toggling both KM and KM Engine off and on in System Preferences > Privacy > Screen Recording
Toggling both KM and KM Engine off and on in System Preferences > Privacy > Accessibility
Using the action on "All screens" and "Main screens" and it works.

For the life of me I can't understand why just the front window isn't working (and that's the only one I need!).