-
-
Save alexbabintsev/5b64a183f2755a74ded091cea28cb132 to your computer and use it in GitHub Desktop.
rotate display using applescript, tested on Mac os High Sierra(10.13)
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
-- | |
-- Created by: v1c77 | |
-- Created on: 2018/7/21 | |
-- | |
-- Copyright © 2018 v1c77, All Rights Reserved | |
-- | |
use AppleScript version "2.7" -- Yosemite (10.10) or later | |
use scripting additions | |
tell application "System Preferences" | |
quit | |
delay 0.5 | |
launch | |
activate | |
set current pane to pane "com.apple.preference.displays" | |
--reveal pane id "com.apple.preference.displays" | |
end tell | |
tell application "System Events" | |
tell application process "System Preferences" | |
tell window "DELL U2415" -- change the window name for different display | |
delay 1 | |
click radio button "Display" of tab group 1 | |
set theGroup to tab group 1 | |
tell pop up button "Rotation:" of theGroup | |
set theStat to value of it | |
click | |
tell menu 1 | |
if theStat = "Standard" then | |
click menu item 4 -- 270 dig | |
else | |
click menu item 1 -- standard | |
end if | |
end tell | |
end tell | |
end tell | |
end tell | |
end tell | |
tell application "System Preferences" | |
quit | |
end tell | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment