Mavericks - I need to be notified when a wifi network becomes available

My university's wifi connection goes up at random times. It's faster, so I would want to be notified when it becomes available so that I can surf faster and I don't have to pay for mobile data that I consume while using my phone as a hotspot.


Solution 1:

You could use Shell script in a Applescript Application that checks the available wifi list. And pops up a notification when the one you want is in the list.

The code is commented to explain how it works.

on idle -- A on idle handler will run the code within it and then set the app to idle. Using little cpu. It will then repeat this every #n of seconds ( determined by its return number)
    set theWifi to "weehronetwork" -- the wifi SSID
    set theList to paragraphs of (do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s| awk '{print $1}'") -- get the wifi list
    if theList contains theWifi then

        display notification with title "The WIFI" subtitle (theWifi & "  IS BACK UP") sound name "Sosumi" -- display a notification.

    end if

    return 60 -- run again in #n seconds

end idle

Save the Applescript as an Application and check Stay open.

enter image description here


When you first run the App. and it displays a Notification, it will then be shown in the System preferences --> Notifications. From here you can determine the Notification type.


enter image description here


enter image description here

Note. I have used a sound in this code. But if you uncheck 'Play Sound for notifications' the sound will not play.