Click at Found Image while Display is sleeping or not connected to monitor?

I have a macro this is supposed to run early morning while my Mac mini’s display is sleeping and most of the times not connected to a monitor.

It makes use of the Click at Found Image Action. The Macro doesn’t run successfully. Is it because the display is sleeping and / or it’s not connected to a monitor at the time? Or can I expect it to work and look for a different issue?

PS is there a log I can check for errors?

Thx v much.

Yes -- in both cases your Mac isn't creating the required "screen image" for you to search. You'll get a Notification along the lines of:

...if you've allowed Notifications from the KM Engine (if you haven't you should, they're invaluable when troubleshooting macros).

You'll also find the error in the KM Engine log (/Library/Logs/Keyboard Maestro/Engine.log), and the logs' folder is easily accessible from the KM Editor's Help -> Open Logs Folder menu item. For the error shown above:

2026-01-27 09:25:32 Action 100945140 failed: Move or Click Mouse no unique image found
2026-01-27 09:25:32 Move or Click Mouse no unique image found. Macro “Scratch 2” cancelled (while executing Move Mouse to (0,0) from the Center of the Found Image).

So you need an awake (and unlocked) display, physical or virtual via screensharing from another device, to use "Found Image".

I'm afraid you'll have to find another way. Many things can be done with a sleeping, or even missing, display -- if you explain what you want to do then someone may be able to help.

Thanks for your response @Nige_s, appreciate you taking the time to respond.

I’m trying to log into my banking website to download a statement. No amount of scripting can get past their bot detectors, so this is the only way left. The macro works when I’m in front of the screen, but need to run this when not in attendance.

I wonder whether there’s a way for me to get the Mac to ‘share’ its screen virtually as if someone is VNCing into it, without it actually being done. That should force it to ‘render’ a display? Will scratch a bit more.

You could try a virtual HDMI dongle (aka HDMI dummy plug) -- no experience of using them for this, but they've solved "can't run headless" problems in the past.

The rest -- the unattended login to your bank (gulp!) and possible breach of Ts&Cs by automating that-which-should-not-be-automated -- are issues only you can consider...

1 Like

I have a laptop that has to run 24/7, and relies on Found Image for a few steps in a periodic macro. I use this routine to wake the screen and make sure it's awake before proceeding:

It uses Keyboard Maestro's Wake Screen action, then moves the mouse, pauses, and moves it back (otherwise I found the screen would go to sleep again). Then it pauses until there's a black pixel at 27,13 ... which happens to be about the center of the Apple icon in the menu bar :).

Once that's there, I know the display is alive and my macro can run. At the end, I use Sleep Screen to put it back to sleep. This won't work without a display connected, but I don't know if it'll work with one of the HDMI dongles attached that simulates a screen.

-rob.

1 Like

I am presuming for this to run, you need to be logged in? For me, to wake screen I need to input my password which I do not want to do using KM or unattended.

In my case, no, because the screen isn't locked with a password. This is a Mac dedicated to one task, in my home behind a firewall, with no data that I really care about on it. Nothing is connected to it, no passwords saved in its keychain, etc. So in my case, I'm as confident as I can be that the wakeup without a password is fine.

-rob.

Awesome thanks, definitely adding this to my macro!

Thanks, I installed a product called Betterdisplay, which creates a virtual screen - it’s intended for ‘headless’ Macs. Will let this thread know if it solves the problem, together with griffin’s suggestion below.

You cannot run macros while the Mac is sleeping (though the Mac sometimes wakes slightly and may be able to run them then).

You cannot do any UI while the Mac is screen sleeping, screen locked or screen saving.

So you will not be able to click, found image or otherwise, if the display is sleeping.

Thanks everyone for your input.

I implemented the ‘wake on screen’ actions as per griffin’s suggestion and then installed a utility called BetterDisplay, which creates a virtual display for headless Macs.

Problem solved - unplugged the monitor and the macro still ran.

Thanks again to everyone chipping in.

3 Likes