Created
June 1, 2024 21:11
-
-
Save erdemkosk/4a603845bd30b3a0e1ba341411904aff to your computer and use it in GitHub Desktop.
Macos Sonoma Sidecar Script
This file contains hidden or 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
do shell script "open -b com.apple.systempreferences /System/Library/PreferencePanes/Displays.prefPane" | |
use AppleScript version "2.4" | |
set iPadName to "Mekpad" | |
tell application "System Events" | |
repeat until (exists window "Displays" of application process "System Settings") | |
delay 0.1 | |
end repeat | |
tell process "System Settings" | |
tell pop up button 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Displays" | |
click | |
delay 0.1 | |
tell (last menu item of menu 1 whose name contains iPadName) | |
click it | |
delay 3 | |
end tell | |
end tell | |
end tell | |
end tell | |
tell application "System Settings" to quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment