I have a wireless network at home, and I also connect to several other networks at work. I do not use DHCP, so I have to manually select a network location each time I turn on my laptop. Using a few scripts I found here, I created this AppleScript that will automatically set the location based on the connected SSID.
It will also open shared drives, if they are defined in the script. If it doesn't find an SSID in the list, it will set the location to Automatic. With some extra work, it should be possible to also set the default printer.
set AirportName to do shell script ¬
"system_profiler SPAirPortDataType|awk -F\": \" '/Current Wireless Network/{print $2}'"
tell application "Finder"
activate
end tell
set CurrentLocation to "Automatic"
if AirportName is "Home" then set CurrentLocation to "Home"
if AirportName is "Work1" then set CurrentLocation to "My work"
if AirportName is "Work2" then set CurrentLocation to "Other Office"
say "I think I am at location " & CurrentLocation & ", I will adjust my network settings accordingly"
tell application "System Events"
click menu item CurrentLocation of menu "Location" of menu item "Location" of menu "Apple" of menu bar 1 of process "Finder"
end tell
if AirportName is "Work1" then mount volume "smb://server/share"
if AirportName is "Home" then mount volume "smb://administrator@mycomputer/share"Mac OS X Hints
http://hints.macworld.com/article.php?story=20060218033247141