I wrote a little script to detect displays for me that I just put in my login items so it does it automaticly on login. Hope it helps someone. Here is the script.

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