Reset display with AppleScript
I've had some problems with a Xserve having a garbled screen (see image) when I log in to it, and since there is no monitor connected, there are no tricks for pressing "detect display" to use for resetting the display. And I'm using it blindly as well, so I needed a way to do it from the terminal. So I put together the below AppleScript that fixes the issue for me.
detect_displays
tell application "System Preferences" activate set current pane to pane "com.apple.preference.displays" end tell tell application "System Events" tell process "System Preferences" select row 1 of table 1 of scroll area 1 of group 1 of tab group 1 of window "Displays" end tell end tell
Basically, all it does is open the system preferences and selects the smallest resolution (the first in the list) which makes the system reset the display and fix the screen. Save this script as an application on the remote machine and run it with "./detect_displays.app" from the terminal.
Hopefully this will help someone that was having the same problem as me.
For this to work, you need to make sure of this:
  • Enable System PreferencesUniversal AccessEnable access for assistive devices
  • Make sure the AppleScript doesn't show a startup dialog
Mer i Tutorials
Skapa snyggare tooltips med jQuery
Snyggare fdelsedagar i iCal och iPhoneiPod touch
Uppdaterad video Nya layoutmodulen
Reset display with AppleScript
Expos  Stickies
Bygg MySQLqueries automatiskt
Mail Processing
Nyckelord: mac os x, xserve eller remote desktop
vad gr man om man har en Xserve ver
Korkade amerikaner
Raid installerad
Xserve RAID har kommit
Leoparden frsenad
P torsdag gller det
Nya servarna p plats
Två månader med Keto
Spelbord v3
Mechanical Age map
More shading and water
Första månaden med Keto
Keto
Fotosession: Tabitha
Utebelysning
Återvinningsskåp
Måla om huset
Byggt hylla till vintunnorna
Dodge RAM
Inline-redigering
Drömmen om ett spa
Dags för carport
Survey Island, what is happening?
Golvprov
Gillestugan uppdaterad!
Spelbord v2
Tre billyhyllor blir två
Gymkort
You can't take the sky from me
Högtalare klara!
eklundh.com tar ned skylten
Högtalare bestämda!
Uppgraderingar biorum
Lord of the Rings-maraton
Ergonomiskt som tusan!
Lego Storm Trooper
Fågel Fenix
Två hyllor på badrummet
Hobbyhörna fixad
Hylla bakom soffan
Modellbygge igen!
Porträtt av u/Flattie-Ratty
Porträtt av u/DangDoood
Buy prints of my maps
Hero Dashboard för Descent
3D-printer
Fältsjukhus 616
Ny kaffemaskin
Porträtt av u/elizabeeeef
Jämförelse 135 mm
Nya objektiv
Porträtt av kompis mamma
Använda utrymmet under trappen
Spelbord
Pimpning av köks-ön
Jag saknar min Dodge!
Acrylic drip