At home I often need to work on a Mac mini that lives in a different room. There are dedicated gadgets—like wireless‑HDMI transmitters—that could mirror the screen, but I’d rather not buy new hardware. Since I already have an iPad lying around, I wondered if I could turn it into a makeshift secondary display. After some trial and error I managed to get a setup that’s good enough for daily use. Here’s what I did and how it feels.
Prerequisites
- The Mac mini and the iPad are in separate rooms.
- I don’t want to walk over to the Mac mini every time I start mirroring.
- Ideally, the iPad should start mirroring automatically the moment I open the cover (not achieved—yet).
- I’m using the Mac mini’s keyboard and trackpad. I’d love to use the iPad’s Magic Keyboard instead, but that’s on hold for now.
Quick summary — Use the “Move to iPad” option on the green maximise button
In macOS, when you hover over a window’s green maximise button, a hidden menu pops up. One of the options is Move to iPad, which mirrors that window to the nearest iPad.
That little option became the core of my workflow.
Automating the click with cliclick
Doing the hover‑and‑click dance by hand gets old fast, so I automated it with cliclick, a command‑line tool that moves the mouse cursor.
brew install cliclick
A sample command:
cliclick m:55,45
That moves the cursor to the area around the green button, makes the hidden menu appear, and from there we can automate the click on Move to iPad. In my setup I use the Visual Studio Code window as the anchor, but any app would work.
Putting it all together with AppleScript
I wrapped the whole sequence in AppleScript so one shortcut triggers everything.
tell application "System Events"
-- Activate VS Code so we know where the window is
tell application "Visual Studio Code" to activate
delay 0.5
-- Move the cursor (tweak coordinates for your screen)
do shell script "/opt/homebrew/bin/cliclick m:55,45"
delay 1 -- wait for the menu to appear
-- Click the “Move to iPad” item
do shell script "/opt/homebrew/bin/cliclick c:55,160"
-- Beep so I know it ran (I can’t see the Mac mini’s screen)
keystroke (ASCII character 7)
end tell
Assigning a keyboard shortcut
Save the AppleScript as a Quick Action in Automator and then bind it to any key:
System Settings → Keyboard → Keyboard Shortcuts → Services → General
From then on, one key press fires the script.
Real‑world impressions & quirks
- Sometimes the Move to iPad menu item doesn’t appear. Running the script a couple of times usually fixes it.
- I rely on the final beep to confirm the script executed, because I can’t see the Mac mini’s display.
- I can check whether the iPad is recognised by looking for the shared‑screen icon that pops up in the Dock when I open a browser.
Current pain points
- macOS occasionally asks for a password instead of Touch ID; the mirroring doesn’t start on that screen. I try to guess whether it’s the password prompt by listening for the Alt+Tab beep and then—fingers crossed—type the password blindly. (Yeah, scary.)
- After mirroring starts I still need the Mac mini’s keyboard and trackpad on the desk. My dream setup would let me keep using the iPad’s Magic Keyboard once the screen is mirrored.
Things that didn’t work
Below are experiments that turned out to be unstable but might help someone else.
Driving System Settings directly
I first tried toggling displays via System Settings with AppleScript, but the UI element hierarchy was unreliable. For reference, here’s the script:
do shell script "open x-apple.systempreferences:com.apple.preference.displays"
delay 5
tell application "System Events"
tell application process "System Settings"
get every UI element of group 1 of group 2 of splitter group 1 of group 1 of window "Display" of application process "System Settings" of application "System Events"
click pop up button "Add" of group 1 of group 2 of splitter group 1 of group 1 of window "Display" of application process "System Settings" of application "System Events"
get every UI element of menu "Add" of pop up button "Add" of group 1 of group 2 of splitter group 1 of group 1 of window "Display" of application process "System Settings" of application "System Events"
click menu item "{iPadName}" of menu "Add" of pop up button "Add" of group 1 of group 2 of splitter group 1 of group 1 of window "Display" of application process "System Settings" of application "System Events"
end tell
end tell
Using the Control Center from the keyboard
After enabling Full Keyboard Access, I tried to start mirroring from the Control Center that pops up with fn + C, but I couldn’t find any way to reproduce that keystroke.
Wrapping up
For now, the cliclick approach is good enough to live with. I still have some gripes, but they’re within tolerance. I might eventually buy a tiny wireless display or a wireless‑HDMI kit, but that’s a future project.
If you’ve found a cleaner way—especially one that lets me keep using the iPad’s Magic Keyboard after mirroring—please let me know!
Cheers 👋