Created
March 9, 2015 14:10
-
-
Save mvaneijgen/2f48f859ca07d2e75b3a to your computer and use it in GitHub Desktop.
Change screen resolution using Applescript works on 10.10 non-rentia macbook
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
-- Launch "System Preferences", open the "Displays" options and change to the "Display" tab | |
tell application "System Preferences" | |
activate | |
set the current pane to pane id "com.apple.preference.displays" | |
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays" | |
end tell | |
local indexToUse | |
-- Now lets make the necessary changes | |
tell application "System Events" | |
tell tab group 1 of window "SyncMaster" of application process "System Preferences" of application "System Events" | |
tell radio group 1 | |
if (value of radio button "Scaled") = 0 then | |
-- Click the "Scaled" radio button | |
click radio button "Scaled" | |
tell table 1 of scroll area 1 of tab group 1 of window "SyncMaster" of application process "System Preferences" of application "System Events" | |
select row 4 | |
end tell | |
else | |
click radio button "Default for display" | |
end if | |
end tell | |
end tell | |
end tell | |
-- Quit "System Preferences" | |
quit application "System Preferences" |
@TheCatCoder I wrote a command line tool, displayplacer, that lets you programmatically change screen resolutions - including the hidden scaled ones.
Thank you for sharing. I works then I expected. π
I add delay 1
before if (value of radio button "Scaled") = 0 then
because waiting for Scaled
radio button to appear.
For the another language and monitor, you have to change monitor name and button names.
For example, Korean, Scaled
to ν΄μλ μ‘°μ
, Default for display
to λμ€νλ μ΄μ μ΅μ ν
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks so much for making this! It works great, except I need to access a resolution that only shows in the hidden "option" menu.
So is there any way of making the mouse click the "Scaled" button with the option key held down, so that the hidden resolutions show up?