Switching between wireless router and Time capsule

Ok - so I’ve been searching for HOURS to find the answer to this, hopefully you guys can help!

I have a wireless router at my home that connects to the internet. I also have a Time Capsule that is NOT plugged into the internet, however I connect to the capsule to allow it to back up.

My ultimate goal is to set up a script into iCal that will change the wireless connection from my router to my TC to allow it to back up. I’ve tried so many things and I can’t get it to work.

Firstly I tried:
tell application “System Preferences” to activate
tell application “System Events”
tell process “System Preferences”
click menu item “Network” of menu “View” of menu bar 1
delay 4
click menu item “Time Capsule network” of menu “Network Name” of window “Network”
end tell
end tell

that didn’t work - I’m having an awful time trying to get the script to click on the Network Name drop down menu to select the correct network. I’ve googled to try to find how to allow applescript to select a drop down menu with no avail.

I also tried setting up locations, but for some reason, when I do a “Home” and “Time capsule” locations when I switch the network from one to the other, the locations never change. Also, when I switch locations, the network doesn’t change!!

If anyone can help out, that’d be fantastic!

Hi,

you can switch a wireless network by calling the Airport Framework executable, an admin password and the password of the base station is required.
The first line disconnects from the current network, the second one connects


property BSSID : "myBSSID"
property adminPassword : "¢¢¢¢¢"
property bssidPassword : "¢¢¢¢¢"

do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z"
do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -A'" & BSSID & "'  --password=" & bssidPassword password adminPassword with administrator privileges