Is there a way to switch target display mode on and off via Keyboard maestro?

I use an iMac as 2nd monitor. However the target display mode always is switched off when the display goes to sleep. I then have to switch manually target display mode on again (more precise: I have to switch it off and on again!).

If KM can do this for me I'll try to write some automation for this...

Here's an untested idea:
Use the Display Layout Changed trigger to trigger a macro when the iMac appears off. Then issue the Type a Keystroke action commands to re-engage it.

I have NEVER used this trigger, and I don't know if it will work in this case.
You will just have to test it to see.

Thanks for the idea with the key stroke! I've made a macro demo for it.

Also, I didn't know about the Display Layout Changed trigger.

In the past I had a macro with ran every couple of seconds checking SCREENCOUNT. But this is so much better! Is this new?

1 Like

According to the wiki article, it was added in KM 9:

The Display Layout Changed trigger (v9.0+)

1 Like