Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disable those pesky hot corners when you don't want them and easily reenable them when you do!
-- By Richard Kulesus, 2009. Released without license!
-- Use this for whatever!
-- I seriously despise code authors who copyright tiny bits of obvious code
-- like it's some great treasure. This is small and simple, and if it saves
-- the next guy some time and trouble coding applescript I'll feel good!
--
-- Quickly change all the hot-corners to do what you want.
-- Particularly useful for presentations and full-screen games.
-- Customize the activity of each hot-corner with "all windows/application windows/dashboard/disable screen saver/none/show desktop/show spaces/sleep display/start screen saver"
-- The MODIFIERS are the keys which can be used to supplement hot-corner activation.
-- Here I've set them all to {}, which is none. Options are "command/control/none/option/shift"
-- Dashboard in a fullscreen application.
--
-- Version 1.0
-- - Initial release
--
tell application "System Events"
activate
if UI elements enabled then
tell expose preferences
set properties of the top left screen corner to {activity:none, modifiers:{}}
set properties of the top right screen corner to {activity:none, modifiers:{}}
set properties of the bottom left screen corner to {activity:none, modifiers:{}}
set properties of the bottom right screen corner to {activity:none, modifiers:{}}
end tell
else
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
end tell
end if
end tell
tell application "System Preferences" to quit
-- By Richard Kulesus, 2009. Released without license!
-- Use this for whatever!
-- I seriously despise code authors who copyright tiny bits of obvious code
-- like it's some great treasure. This is small and simple, and if it saves
-- the next guy some time and trouble coding applescript I'll feel good!
--
-- Quickly change all the hot-corners to do what you want.
-- Particularly useful for presentations and full-screen games.
-- Customize the activity of each hot-corner with "all windows/application windows/dashboard/disable screen saver/none/show desktop/show spaces/sleep display/start screen saver"
-- The MODIFIERS are the keys which can be used to supplement hot-corner activation.
-- Here I've set them all to {}, which is none. Options are "command/control/none/option/shift"
-- Dashboard in a fullscreen application.
--
-- Version 1.0
-- - Initial release
--
tell application "System Events"
activate
if UI elements enabled then
tell expose preferences
set properties of the top left screen corner to {activity:all windows, modifiers:{}}
set properties of the top right screen corner to {activity:all windows, modifiers:{}}
set properties of the bottom left screen corner to {activity:show spaces, modifiers:{}}
set properties of the bottom right screen corner to {activity:show desktop, modifiers:{}}
end tell
else
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
end tell
end if
end tell
tell application "System Preferences" to quit
@klynch

This comment has been minimized.

Copy link
Owner Author

klynch commented Feb 15, 2011

To run, open both scripts with AppleScript Editor, then for each script go to File -> Save As, Select "Application" and click "Run Only". This will produce two applications.

@lottscarson

This comment has been minimized.

Copy link

lottscarson commented Apr 9, 2013

This is awesome, thanks. Still works on Mountain Lion!

@ghost

This comment has been minimized.

Copy link

ghost commented Apr 14, 2013

This worked well, but there is a problem with trying to set up LaunchPad in Mountain Lion. You cannot just use "LaunchPad" or any variation thereon.
I found that using the variable

«constant ****lpad»

works to enable launchpad.

Credit to this conversation: http://macscripter.net/viewtopic.php?id=37799

@warkior

This comment has been minimized.

Copy link

warkior commented Jun 7, 2013

Super helpful! Thanks. To clarify a tiny issue I had, on mountain lion, to get application windows, use "activity:application windows,"

@ghost

This comment has been minimized.

Copy link

ghost commented Aug 29, 2013

very helpful, resolved my problem with game Dota2 =) Thank you!

@madsskoett

This comment has been minimized.

Copy link

madsskoett commented Oct 24, 2013

Mavericks breaks this, and i can't seem to find anything about expose or hot corners in the dictionary. Do you or anyone know how to fix it?

@Najadorel

This comment has been minimized.

Copy link

Najadorel commented Oct 28, 2013

Yeah Mavericks broke the script, can you flux it klynch plz!

@hng

This comment has been minimized.

Copy link

hng commented Dec 3, 2013

An alternative Script that toggles Hot Corners can be found here: https://discussions.apple.com/message/23989931#23989931

If you have set german as your language see my modifications here: https://gist.github.com/hng/7774920

@klynch

This comment has been minimized.

Copy link
Owner Author

klynch commented Dec 14, 2013

I don't have any OSX devices anymore. Thanks for the link @hng.

@musichook

This comment has been minimized.

Copy link

musichook commented Jul 3, 2014

Whats "activity" parameter for sleep monitor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.