I like being able to zoom in on things with my magic mouse ‘wheel’, and Universal access lets me do it.
Unfortunately in Lion (10.7.0), the zooming feature just stops working now and then. The fix involves opening System Prefs, bringing up the Universal Access pane, its ‘seeing’ sheet, clicking the option button, unchecking a checkboxx, closing the option sheet and reopening, clicking the checkbox again, closing the option sheet, and quitting System prefs.
That’s a lot of work, so I decided to see how gui scripting works in Lion.
This script automates the process:
--ResetScrollWheelZooming
--BP Aug, 2011
-- Applescript to tickle the "Use scroll wheel with modifier keys to zoom" checkbox
-- in the Universal Access prefs pane of OS 10.7.0 (Lion, initial release)
-- The setting doesn't stick on some Macs.
-- Toggling the button off and on gets things working again.
-- Once open in AppleScript Editor, save a copy of this as an App.
-- Resetting the zoom will then be just a double click away.
-- The script could also be converted into a Service, and have a keyboard shortcut,
-- but I expect Apple will fix things by the time 10.7.2 comes out.
-- see this link for pane stuff:
--http://www.macosxautomation.com/applescript/features/system-prefs.html
set wantedpane to "universalaccess"
set wantedanchor to "Seeing_VoiceOver"
------------------------ For Clarity, Show pane step by step:
--tell application "System Preferences"
-- activate
-- set the current pane to pane id ("com.apple.preference." & wantedpane)
-- get the name of every anchor of pane id ("com.apple.preference." & wantedpane)
-- --> returns: {"keyboardTab", "shortcutsTab", "keyboardTab_ModifierKeys"}
-- reveal anchor wantedanchor of pane id ("com.apple.preference." & wantedpane)
-- end tell
-- return
-------------------------------------
--- Show pane, all at one go:
tell application "System Preferences"
activate
reveal anchor wantedanchor of pane id ("com.apple.preference." & wantedpane)
end tell
--------------------
tell application "System Events"
tell process "System Preferences"
tell window "Universal Access"
click button "Options." of tab group 1 -- click the + button
click checkbox "Use scroll wheel with modifier keys to zoom" of sheet 1
click button "Done" of sheet 1
delay 0.2
click button "Options." of tab group 1 -- click the + button
click checkbox "Use scroll wheel with modifier keys to zoom" of sheet 1
click button "Done" of sheet 1
end tell
end tell
end tell
tell application "System Preferences"
quit
end tell