Created
August 10, 2015 19:02
-
-
Save pbojinov/4afe4c7526df40b21bd5 to your computer and use it in GitHub Desktop.
OSX Automator script to toggle hot corners on/off with some predefined defaults. Particularly useful when playing games and need to turn off hot corner actions quickly and restore to default after.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
property theSavedValues : {"Application Windows", "Mission Control", "Desktop", "Notification Center"} -- for example | |
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 "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
if you get System Events got an error: Can’t get window "Mission Control" of process "System Preferences"., just add "delay 0.5" after 'tell application "System events"'