Created
December 8, 2021 10:04
-
-
Save yangwao/835f7e5ab2ed1ee86ec948f86139121b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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