I have an apple script that I can manually run that will connect to a couple network drives. I would like it to have that script run when my mac connects to a specific wireless network connection (SSID). Is there a way to attach the script to that action? The network drives are not available unless I am on that network.

This may not be the place to ask this since is not technically an applescript coding question but any suggestions will be appreciated.


This should work. Replace the variables as needed.

set workSSID to "WORK SSID NAME"
set workVolumes to "smb://YOUR NETWORK DRIVES"

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

if currentSSID = workSSID then
        mount volume workVolumes

    end try

end if
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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