Ipad screen mirroring for flexgate macbook?

First post here. I have a flexgate macbook pro (no screen output) running Ventura. Im wondering if I can run a macro which will allow me to start screen mirroring via a hotkey and let me use my ipad air as a display? I do not own Maestro yet, I just discovered it and am hoping this may be the solution ive been looking for.
Edit: i should have mentioned that I have an external monitor that I can use to set up the headless macbook.

How do you do it manually?

I'm not sure if Keyboard Maestro will be able to perform UI actions in headless mode - UI actions cannot happen when you are screen saving/locked/sleeping, so it is quite possible they wont work in headless mode either.

But there might well be a Shell Script or AppleScript method of doing it and if so then Keyboard Maestro would run the script on command.

When i used the term headless i meant only that there was no video displayed. The macbook thinks its outputting video, it just doesnt know that the connector to the screen is broken because of poor design.

You normally enter screen mirroring mode by opening the control center menu (upper right) and selecting screen mirroring. Setup of choosing the device to connect to, screen arrangement etc. can done in the settings - > displays pref. panel and can be done ahead of time(using an ext monitor).

Did you try an AppleScript like this:

I did try a different script, but it really needed to be triggered by the mac. I tried a different macro package to accomplish this without success. I f i can trigger a script via hotkey with KM then it may work for me. I just wanted a better sense of my chances for success before parting with the money (fixed income, retired) thanks for replying directly, i really appreciate your time. Ill keep playing with scripts and reply back later.

Keyboard Maestro can run the script for you.

Sure, Hot Key trigger and Execute an AppleScript action.

Thanks, after thrashing about for the better part of today, I think I need to learn more applescript, especially due to the changes in Ventura to the System Preferences. I can get the display prefs open, I just cant get into the page and select things. I'll keep pecking away. Ive DL'd KM as a trial and will figure that out too. Thanks for all of your replies.

1 Like

Edit 8/8/23
Relying almost entirely on the posted work of user Zarralaz here:
https://www.reddit.com/r/applescript/comments/118ivys/updateguide_macos_ventura_system_settings_with/

I have gotten a macro with a script to work. It works perfectly if I press the "run" button from within the KM edit window, but not on any of the various triggers i have tried.

(Edit, a few hours later)
works fine now, macro group wasnt enabled! MacOS still throws "must update to connect" error but its just a warning) .

Thank You to Zarralaz for your work, well done!