If you share files, printers, internet, or other things from your Mac, it can get annoying constantly navigating through System Preferences turning it on and off. Here's an AppleScript that can toggle any of those settings on and off with one click.

OS X's sharing features are pretty cool, but if you leave them on all the time, you may be leaving yourself vulnerable to outside attackers. As such, you probably turn these settings on and off a lot, which can get annoying since they're buried in System Preferences. To speed up the process, paste this code into AppleScript Editor:

The above script toggles Internet Sharing on and off, though with a bit of tweaking you can make it work for any of the other sharing preferences. Just change row 11 in line 10 of the script to match the checkbox you want to check—for example, File Sharing is the 3rd checkbox down, so you'd change row 11 to row 3. When you're done, just save the script as an application. Now, whenever you want to toggle that setting, just double-click on the script (or, even better, launch it with Quicksilver) to toggle that setting. It'll still open up System Preferences, but it'll do all the clicking for you, and faster than you probably did it yourself. Hit the link to read more.