CODE
tell application "System Preferences" to activate
delay 2
tell application "System Events"
tell process "System Preferences"
click menu item "Displays" of menu "View" of menu bar 1
delay 3
tell button "Detect Displays" of group 1 of tab group 1 of window "Display" to click
end tell
end tell
delay 2
tell application "System Events"
tell process "System Preferences"
click menu item "Displays" of menu "View" of menu bar 1
delay 3
tell button "Detect Displays" of group 1 of tab group 1 of window "Display" to click
end tell
end tell