Hi Viking OSX,
Thanks for some ideas. I tried both using terminal to see the results and while they are a little slow they worked.
I'm am going to include with this post my script and ask if you would mind showing me where to incorporate either suggestion. You helped me with this one when I had updated the macOS 14.4. Now with 15.0 I would like to get it working again. Everything is working with the exception of the getting and/or displaying the SSID.
I run this at startup and the current script usually took 5-10 seconds before displaying the SSID, so if I can get it to work with one of the system_profiler suggestions the slowness should not be an issue.
Thanks for your help. It's appreciated.
Diveboss164
----- My current Automator application----
use framework "CoreWLAN"
use scripting additions
property ca : current application
# property dialog_icon : "Macintosh SSD:Users:user:Automator Custom Icons:Synology 5 bay DiskStation DS1512+.icns"
property app_icon : "Macintosh SSD:Users:me:Pictures:Logos:Image2icon:Synology 5 bay DiskStation DS1512+.icns" as text
set Refresh_time to 5 -- the delay between refresh of the dialog
set wait_time to 60 --total delay for user to decide
set Decision to 0
repeat until (Decision > 0) or (wait_time = 0)
set Decision to Get_User_Feedback(wait_time, Refresh_time)
set wait_time to wait_time - Refresh_time
end repeat
-- display alert "Decision is " & Decision
-- 0 means no answer
-- 1 means Connect
-- 2 means don't connect
if Decision is 2 then
quit
end if
-- your program here
if Decision = 1 or Decision = 0 then
tell application "Finder"
try
mount volume "smb://VogtStudios/home/Drive"
delay 1
end try
end tell
-- end routine
return
on Get_User_Feedback(Remain_time, Step_delay)
set wait_time to 5 as integer
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.
You will be connected to the " & mySSID & " Server in " & Remain_time & ¬
" seconds. If your are not on MyServer Local Area Network, please select 'Don't Connect'." buttons {"Don't connect", "Connect Now"} default button ¬
"Connect Now" with icon app_icon as alias giving up after wait_time
if gave up of feedback then
return 0
else if button returned of feedback is "Connect Now" then
return 1
else
return 2
end if
end Get_User_Feedback