Skip to content

Instantly share code, notes, and snippets.

@jbrowning
Created December 1, 2020 14:22
Show Gist options
  • Save jbrowning/6475d4071df1d4fa0026e0ba1890bfec to your computer and use it in GitHub Desktop.
Save jbrowning/6475d4071df1d4fa0026e0ba1890bfec to your computer and use it in GitHub Desktop.
AppleScript to toggle Sidecar in macOS 11 Big Sur
property iPadName : "The iPad Name"
activate application "SystemUIServer"
tell application "System Events"
tell application process "ControlCenter"
set displayMenu to (menu bar item 1 of menu bar 1 whose title contains "Display")
click displayMenu
delay 0.1
click checkbox iPadName of scroll area 1 of group 1 of window "Control Center"
click displayMenu
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment