Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Script no longer gets SSID. macOS 14.4 Sonoma

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


set feedback to display dialog ("You are currently connected to:


WiFi SSID: " & mySSID as string) & ". 


I used to see: "WiFi SSID: <current SSID>. Where <current SSID> is the wifi I am connected to.


Now I see: "Wifi SSID ."


This happened after the update to macOS 14.4 Sonoma.


Can anyone point me to the problem or suggest a correction that will work on macOS 14.4>



MacBook Pro 16″, macOS 14.4

Posted on Mar 11, 2024 1:34 PM

Reply
Question marked as Best reply

Posted on May 4, 2024 6:31 AM

I see two things I would change:


Separate your handlers from the script.

--end routine
return


and replace:

	set mySSID to (ca's CWWiFiClient's sharedWiFiClient)'s interface()'s ssid()
	set feedback to display dialog "You are currently connected to " & mySSID & " LAN.


With:

	set wif to ca's CWInterface's interface
	set mySSID to (do shell script "networksetup -getairportnetwork " & (wif's |name|) & " | awk '{print $4}'")
    set feedback to display dialog "You are currently connected to " & mySSID & " LAN.



This definitely works to get the SSID name string in a compiled Automator application.


Tested: Sonoma 14.4.1.

Similar questions

31 replies

Script no longer gets SSID. macOS 14.4 Sonoma

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