Saturday, May 12, 2012

How to toggle Mac WiFi (Airport) via a keyboard combination with BetterTouchTool

I was playing around with BetterTouchTool today (which, by the way, is one of the best Mac addons I've ever seen) and decided that I wanted to have a keyboard combination to toggle my Wifi settings.  BetterTouchTool gives you the ability to execute a script, however, that causes a Terminal window to open if you write a bash script.  This can be disabled through other means, but I found out it's easiest to just write an AppleScript file.

The code below is what I'm using to do this.  I've bound this script to a keystroke combination via BetterTouchTool, and it's working perfectly:


  1. This comment has been removed by the author.

  2. Thanks! A good way for saving battery. BetterTouchTool should be a standard for Apple computers! ;)