Skip to content

Instantly share code, notes, and snippets.

@yangwao
Created December 8, 2021 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yangwao/835f7e5ab2ed1ee86ec948f86139121b to your computer and use it in GitHub Desktop.
Save yangwao/835f7e5ab2ed1ee86ec948f86139121b to your computer and use it in GitHub Desktop.
set controlCenterName to "Control Centre"
set connectToSidecarName to "Connect to Sidecar"
set iPadName to "Magnetic tunnel"
tell application "System Events"
tell application process "ControlCenter"
set controlCenterIcon to (menu bar item controlCenterName of menu bar 1)
click controlCenterIcon
if not (exists (window controlCenterName)) then
click controlCenterIcon
end if
delay 0.3
tell group 1 of group 1 of window controlCenterName
### probably handle if it's connected to cycle in case of glitches?
click checkbox connectToSidecarName
delay 0.3
click checkbox iPadName
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment