Need some Help? Have a tip to share?

Email me at MacTipper@gmail.com, or, leave a comment!

Learn How to Win Free Stuff Online


4/9/08

Lava Corners: Turn On and Off Hot Corners


In the comments of my post on hot corners, a commenter suggested that it would be nice if one could disable hot corners for a short time. A great use for this would be if somebody borrows your computer and the hot corners keep activating. Well, I completely relate to this (on the borrowing end of things) and must say that this would be very nice. After a little bit of googling and some trial and error, I came up with an applescript to do the trick.

There are two forms of the applescript. One is a switch. That is, when you launch it, it will turn on hot corners if they're off or vice-versa.

The other applescript is actually the more interesting of the two. This one will display a dialog asking if you want to enable or disable hot corners. The interesting part is that the button that's selected (the one you can press enter to select) is the one that you probably want to select. So, if you disabled hot corners, then the default option is enable them again.

From here, you can just download you desired version:

Lava Corners (With Dialog)
Lave Corners (Switch)
Lave Corners (Both)

Like most my other applescripts, these both can be opened and edited in Script Editor.app. (They're not run only.)


Now, onto the applescripting:

To get the button to change was pretty easy. Basically, I had the default button number be a property. Then, when you selected one of the buttons, the number was changed to the appropriate button. An example script for this would be:

--This property sets what the default button is after first compiling the script.

property button_number : 2


display dialog "Pick a button:" buttons {"Cancel", "Two", "Three"} default button button_number

--We don't need to provide a default button for "Cancel" because Cancel can always be accessed with Cmd-. (period)

set button_returned to button returned of the result


--The default button right now is the second one.

if button_returned is "Two" then

--action

--After we select two, the default button becomes 3 because of the following line:

set button_number to 3

end if


if button_returned is "Three" then

--action

--If we selected the third button though, the default button will be set to 2 through the following line:

set button_number to 2

end if


This is a good format to use in on/off scripts or scripts where you want to prompt the user to choose something based upon previous decisions.

3 comments:

Anonymous said...

would someone please tell an idiot like myself how to turn off hot corners without me having to read war and peace.

thanks

MacTipper said...

Turn them off permanently? Go to the "Expose & Spaces" System Preference pane and change all the corners to nothing.

Chris said...

Wow this is nice.I especially like the default option changing to the one you want. this also comes in handy for gaming its annoying when your playing a game full screen and you accidently bring up the dashboard or spaces.

Thanks

Post a Comment

Subscribe Via Email!

Enter your email address:

Delivered by FeedBurner