10.7: Applescript to escape Zoomed In screen

Dec 08, '11 07:30:00AM

Contributed by: jgl24

I was trying to get full screen zoom to work in Lion (don't know why it doesn't) and I read a hint that told me to go to System Preferences » Universal Access and turn the 'Zoom in window' checkbox on and back off again. It worked fine for me but when my friend did it he got stuck zoomed into the middle of his screen.

After many unsuccessful attempts to escape, including remote screen sharing, shortcut keys to disable screen sharing (which again I don't know why they don't work in Lion) we succeeded with this plan and this might help you if all else fails. I don't know if rebooting would help, he didn't want to risk losing his code so it was only last resort.

I hope you don't have to do this, but at least it gave some practice in User Interface Scripting. Here's the script:
#!/usr/bin/osascript

tell application "System Events" to set frontmost of process "System Preferences" to true
tell application "System Events"
  tell process "System Preferences"
    tell radio group 3 of tab group 1 of window 1
      tell radio button 2
        click
      end tell
    end tell
  end tell
end tell

[crarko adds: Nothing really earthshaking here, but I'm a soft touch for persistence and creativity in problem solving.]

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20110816155616517