When I connect an external display I need a script to automatically:
1. Check if external monitor is connected by detecting the "Attachment" tab exists.
2. Activate the "Attachment" Tab to focus.
3. Turn ON the mirroring only if it's off.
Set Resolution as:
4. "Optimize for" -> "Built-in Retina Display" (changing combobox).
5. "Scaled" (Radio button selection) .
6. "Select 1440 x 900". (option which is on the left of default).

I have a MacBook Pro 2017 running macOS 10.13, High Sierra, and a FullHD external display.
I prefer "scaled" down resolution of 1440 x 900 for most work instead of my system's default resolution of 1680 x 1050.

When sometime I connect the external display the MacBook Pro changes the resolution as per the external display and I then always need to resetup.

I have been trying to write up a applescript but not been able to get through. I dont want to use any extra apps like SwitchResX for this single case.

I have already tried the scripts at Is it possible to change display resolution with a keyboard shortcut? The script returns the 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.
  • Update: i have resoled the issue with the script by doing a minor change as below. click radio button 3 of radio group 1 of group 2 of tab group 1 Commented Dec 2, 2017 at 16:47
  • 1
    Great to see you got it resolved. :) Perhaps you'd like to add an answer your own question, as this will no doubt be useful to other users.
    – Monomeeth
    Commented Dec 2, 2017 at 20:06
  • Sorry @Monomeeth i am still long way off to get all things working..still looking for a right way to detect external monitor is plugged. Will surely share if i could get it all done. Commented Dec 4, 2017 at 2:19


You must log in to answer this question.

Browse other questions tagged .