Skip to content

Instantly share code, notes, and snippets.

@hng
Last active July 24, 2018 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hng/7774920 to your computer and use it in GitHub Desktop.
Save hng/7774920 to your computer and use it in GitHub Desktop.
Toggles Hot Corners on Mavericks OS X 10.9
-- based on: https://discussions.apple.com/message/23989931#23989931
property theSavedValues : {"Dashboard", "Launchpad", "Mission Control", "Schreibtisch"} -- change "Schreibtisch" to "Desktop" if not german etc.
tell application "System Preferences"
activate
set current pane to pane id "com.apple.preference.expose"
tell application "System Events"
tell window "Mission Control" of process "System Preferences"
click button "Aktive Ecken …" -- on english computer: "Hot Corners…"
tell sheet 1
tell group 1
set theCurrentValues to value of pop up buttons
if theCurrentValues is {"-", "-", "-", "-"} then
repeat with i from 1 to 4
set thisValue to item i of theSavedValues
tell pop up button i
click
click menu item thisValue of menu 1
end tell
end repeat
else
copy theCurrentValues to theSavedValues
repeat with i from 1 to 4
tell pop up button i
click
click last menu item of menu 1
end tell
end repeat
end if
end tell
click button "OK"
end tell
end tell
end tell
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment