Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Linksys dual band router. Near the back of our house (which is where our computers are mostly located) only the G network really comes through so when I'm working in the front of our house, I like to connect to the N network for the extra speed. Unfortunately we are unable to move our router. If it is possible, I would like my Mac to automatically switch networks depending on the signal strength. Is there a way to do this? Our Macs are running 10.8. Thanks

share|improve this question
At (2014-12-22): "… a script to check the RSSI value of the currently connected SSID … change to … SSID with lower RSSI … triggered by network change. …". – Graham Perrin Mar 18 '15 at 12:09

Not saying this is ideal or works well. But Just to give you an idea.

You can use command line tools to write a script that checks the strength. and then changes the network as needed.

To get the strength you can use this command line code:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I |grep -i "agrCtlRSSI:"

Look at the man pages for /usr/sbin/networksetup for changing the setup.

As an example here is a quick applescript. It only runs once as it is only an example of use. But in your script I would do it as a LaunchAgent There is an app called lingon that simplifies the writing of LaunchAgents. LaunchAgents can startup apps, run scripts at specific times, regularly or when something happens.

I hope this helps

set wifi1 to "wifissid1"
set wifi2 to "wifissid2"

    set strength to last word of (do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I |grep -i \"agrCtlRSSI:\"") as number
    log strength
end try
set network to do shell script "/usr/sbin/networksetup -getairportnetwork en1"
log network

if strength is less than 50 then

    if network is not equal to "Current Wi-Fi Network: " & wifi1 then

        do shell script "/usr/sbin/networksetup -setairportnetwork en1 " & wifi1 & " &> /dev/null & "

    end if


    if network is not equal to "Current Wi-Fi Network: " & wifi2 then

        do shell script "/usr/sbin/networksetup -setairportnetwork en1 " & wifi2 & " &> /dev/null & "

    end if

end if
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.