The script works fine when I’m logged in through another computer. It doesn’t work unless you are logged in. So it’s definitely not a script (see error picture below).
My suspicion is that somehow MM notices (so to speak) that no one is there, and that’s why the screenshot doesn’t work.
MM has a dongle (brand MI TV) in the screen port. I had to do this because screen sharing (with remote management) would not work properly without a monitor attached. The dongle does the job perfectly (see also the control panel error picture below).
The dongle is present during the boot process, so the Mac probably thinks it has a screen. I just want to take a screenshot, but it doesn’t seem to be recognized as a screen.
Does anyone have any ideas on how to trick the system into thinking someone on the screen is looking at it and make the image work? Again, it works when I’m logged in, but not without it.
Here is a picture of the control panel after connecting or disconnecting the dongle.
Here is a picture of the notification I receive when the script runs, no screenshot is sent.
I look forward to your thoughts.