How To Get WiFi SSID With AppleScript

Hello all, I would like to be able to get my current WiFi SSID set as an applescript variable

MacBook Pro, OS X Mountain Lion (10.8.4)

Posted on Jul 20, 2013 2:22 PM

Reply
Question marked as ⚠️ Top-ranking reply

Posted on Jul 20, 2013 3:40 PM

set mySSID to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resour ces/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'"

display dialog "SSID = " & mySSID as string

5 replies
Sort By: 
Question marked as ⚠️ Top-ranking reply

Jul 20, 2013 3:40 PM in response to RyanSiebecker

set mySSID to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resour ces/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'"

display dialog "SSID = " & mySSID as string

Reply

Jul 20, 2013 6:20 PM in response to RyanSiebecker

Sorry, somehow it got garbled when I posted it. This should work:


set mySSID to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'"


This will set the variable mySSID to the current SSID.

Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How To Get WiFi SSID With AppleScript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.