Last active
August 22, 2023 12:42
-
-
Save twlz0ne/4708084 to your computer and use it in GitHub Desktop.
Rotate Display using AppleScript for MacOSX 10.6.8
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
tell application "System Preferences" | |
quit | |
delay 1 | |
launch | |
activate | |
tell application "System Events" | |
key down {option, command} | |
end tell | |
reveal pane id "com.apple.preference.displays" | |
tell application "System Events" | |
key up {option, command} | |
tell process "System Preferences" | |
tell window "Color LCD" | |
click pop up button "Rotation:" of group 1 of tab group 1 | |
keystroke "90" & return | |
set success to 0 | |
repeat until success is equal to 1 | |
delay 1 | |
try | |
tell sheet 1 | |
click button "Confirm" | |
set success to 1 | |
end tell | |
on error errText | |
log errText | |
delay 1 | |
end try | |
end repeat | |
end tell | |
end tell | |
end tell | |
end tell |
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
tell application "System Preferences" | |
quit | |
delay 1 | |
launch | |
activate | |
tell application "System Events" | |
key down {option, command} | |
end tell | |
reveal pane id "com.apple.preference.displays" | |
tell application "System Events" | |
key up {option, command} | |
tell process "System Preferences" | |
tell window "Color LCD" | |
click pop up button "Rotation:" of group 1 of tab group 1 | |
keystroke "Standard" & return | |
-- If "Standard" is selected, no confirmation dialog is displayed. | |
end tell | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use https://github.com/CdLbB/fb-rotate instead.
List the display id's with other information, e.g.
Rotate screen with by d (display) and r (rotate) options: