Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Automatically set location based on connected SSID' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically set location based on connected SSID
Authored by: markformac on Feb 24, '06 12:38:44AM

where does this go? I need baby steps here. And can anyone tell me how to use SleepWatcher? I installed but there are no instructions on how to use it. It states there are instructions within Man...but where does that reside?

---
Mark Brooks



[ Reply to This | # ]
Automatically set location based on connected SSID
Authored by: mirrorspock on Feb 24, '06 03:56:13AM
put it where
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
is now. also remove the
tell application "Finder"
  activate
end tell
it's no longer needed

might as well post the complete script again:
set AirportName to do shell script ¬
  "system_profiler SPAirPortDataType|awk -F\": \" '/Current Wireless Network/{print $2}'"

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"

do shell script "/usr/sbin/scselect '" & CurrentLocation & "'"end tell

if AirportName is "Work1" then mount volume "smb://server/share"
if AirportName is "Home" then mount volume "smb://administrator@mycomputer/share"


[ Reply to This | # ]