Notefile: on the Mac App Store, iCloud, and more Now available on the Mac App Store Dashboard is great for simple widgets like Notefile…
Force Snow Leopard to reconnect to your wireless network
I recently bought a Mac mini to set up as a file server at home, and I’ve run into this fun problem in Snow Leopard: if one of my Macs get disconnected from my wireless network, it won’t reconnect automatically. Since I’m running my Mac mini without a display or keyboard connected, that means I have to plug them in just to fix the problem. (Normally I just connect with Screen Sharing, but clearly I can’t do that if it’s not on the network.)
I’ve tried an endless number of things to fix the problem. AirPort is set as the first connection type to try, and my network is in the list of Preferred Networks. It connects fine after booting up, but never after the connection is lost. So I’m pretty sure this is a bug, and it will probably get fixed in 10.6.2 or some other update—hopefully soon.
I got tired of waiting for a fix though, so I wrote an AppleScript to solve the problem. This script will check if your Mac is connected to a network. If it’s not, it will connect to the network you specify in the first line.
set theNetwork to "NetworkName" tell application "System Events" tell process "SystemUIServer" set menuItems to menu bar items of menu bar 1 repeat with menuItem in menuItems if description of menuItem is "AirPort Menu Extra" then set theStatus to value of menuItem end repeat end tell if theStatus is "No Signal" then tell application "System Preferences" to set current pane to pane id "com.apple.preference.network" tell process "System Preferences" set networkServices to rows of table 1 of scroll area 1 of window 1 repeat with networkService in networkServices if "AirPort" is in (value of static text 1 of networkService) then select networkService delay 3 click pop up button 1 of group 1 of window "Network" set menuItems to menu items of menu 1 of pop up button 1 of group 1 of window "Network" repeat with menuItem in menuItems if (title of menuItem is theNetwork) then click menuItem exit repeat end if end repeat end if end repeat end tell tell application "System Preferences" to quit end if end tell
You can download the script here. After you download it you’ll need to open it in AppleScript Editor and edit the first line. Change NetworkName to the actual name of your network (the SSID). This script also requires you to enable GUI scripting—just open System Preferences, click Universal Access, then check “Enable access for assistive devices” at the bottom.
In order to make the script really useful, you’ll also need to set it to run periodically. One of the easiest ways to do this is to download Lingon. (Click the link with a name like “Lingon-2.1.1.zip”, not the “LingonSource-2.1.1.zip” one.) After you download Lingon and move it to your Applications folder, open it up.
Once Lingon is open, click the New button. Fill out the settings like this:
Make sure the path is correct in the “What” section. If you place the Network.scpt file in your Documents folder, then enter the same path that’s in the example, but change “mike” to your own short user name (the name of your home folder). If you like you can adjust the script to run more or less often. 3 minutes works pretty well for me.
Click the Save button when you’re done. After that you’ll need to log out (through the Apple menu) and then log back in. Or you can just restart your computer. If you’ve set everything up correctly, you’re done.
This is far from an ideal solution, of course, but until Apple fixes the problem it should make my life a lot less frustrating. Hopefully it will help some of you too!
Our Mac software, Mountain Lion, and the Retina Display OS X Mountain Lion is now available, and the MacBook Pro with Retina Display has been out…
Junecloud and Lion compatibility The latest version of Mac OS X, Lion, is now available, and you may be wondering if our…
Introducing Notefile Notefile is a project I’ve had kicking around for a long time. It all started with…
Delivery Status for Mac 5.3 beta 4 Update: This beta is now closed, thanks for your help! New in this version: •…