Hey guys, I’m really glad there is somewhere I can come for help. I don’t know anything about Applescript but I’m SO CLOSE! Quick idea, then problem.
Working at a location that has WPA2E wireless. I have setup the script so that it auto makes a new location and auto adds the profile. The problem we have is that people already have a new location or already have the profile so I need to delete it first before I add it.
Unfortunately the Applescript ends when it does not find the network. How can I have the applescript say ok fine and just continue on?
do shell script "/usr/sbin/networksetup -removepreferredwirelessnetwork en1 NETWORKNAME"
do shell script "/usr/sbin/networksetup -removelocation en1 LOCATIONNAME"
do shell script "/usr/sbin/networksetup -createlocation LOCATIONNAME populate"
do shell script "/usr/sbin/networksetup -switchtolocation LOCATIONNAME"
do shell script "/usr/sbin/networksetup -addpreferredwirelessnetworkatindex en1 NETWORKNAME 0 WPA2E"
If the NETWORKNAME in step one does not exist it fails and errors out. How do I get it to continue even with an error?
It will also fail on step 2 because the LOCATIONNAME might not exist.
Thank you guys so much in advance this is going to be so huge if I can get this working perfectly.