I found the following script from Change laptop Mac OS X wallpaper upon location but it reads an error when I run it, saying "grep: SSID:: No such file or directory".
set mySSID to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I|grep \" SSID: \"|cut -c 18-"
if mySSID is equal to "NETWORK_NAME" then
tell application "Finder"
set desktop picture to {"Macintosh HD:Users:USER_NAME:Desktop:IMAGE_NAME.jpg"} as alias
end tell
end if
I'm new to Automator and scripts but want to learn and understand why this isn't working.