I want to connect to the iPad via universal control, but this script is still missing the last step.
It also needs to click on the device with the name ipad to connect. Can you tell me what other code needs to be added?
My system is monterey 12.5.
tell application "System Events"
tell its application process "ControlCenter"
click menu bar item "Control Center" of menu bar 1
tell its window "Control Center"
-- Monterey
if exists checkbox "Screen Mirroring" then
tell its checkbox "Screen Mirroring"
perform action 2
delay 1
end tell
end tell
else
-- big sur
-- "action 1" instead of "action 2"
if exists (checkbox "Screen Mirroring" of group 1 of group 1) then
tell its checkbox "Screen Mirroring" of group 1 of group 1
perform action 1
delay 1
end tell
end if
-- ventura??
-- "Screen Mirroring" is inside a "group 1"
if exists (checkbox "Screen Mirroring" of group 1) then
tell its checkbox "Screen Mirroring" of group 1
perform action 2