helmedeiros / dotfiles

my dotfiles
5 stars 0 forks source link

Bug - Should change to best resolution #19

Closed helmedeiros closed 7 years ago

helmedeiros commented 7 years ago

Looks like resolution script is broken for macOS Sierra:

$ res
/Users/<username>/.dotfiles/bin/res:1429:1433: execution error: System Events got an error: Can’t get radio group 1 of group 1 of tab group 1 of window "Built-in Retina Display" of process "System Preferences". Invalid index. (-1719)
helmedeiros commented 7 years ago

Changing to have Default to Display resolution:

screenshot 2017-05-07 18 57 06

Executing script:

tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
    click radio button "Display" of first tab group
    click radio button "Scaled" of first radio group of first tab group
    tell first radio group of second group of first tab group
        set isDefault to get value of second radio button
    end tell
    if isDefault then
        click last radio button of first radio group of second group of first tab group
    else
        click second radio button of first radio group of second group of first tab group
    end if
end tell
screenshot 2017-05-07 18 59 13