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: mirrorspock on Feb 23, '06 11:22:26PM
the whole set location part can be replaced with:
do shell script "/usr/sbin/scselect '" & CurrentLocation & "'"
now the option assistive devices in system is no longer needed.
thanks to Richard F. for pointing this out to me.

[ Reply to This | # ]
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 | # ]
Automatically set location based on connected SSID
Authored by: kholburn on May 17, '06 08:48:45PM
Why is this line which runs a shell script:

do shell script "/usr/sbin/scselect '" & CurrentLocation & "'"
better than the one line of applescript ?:

set CurrentLocation to "Automatic"


[ Reply to This | # ]
Automatically set location based on connected SSID
Authored by: GaelicWizard on May 18, '06 07:17:01AM

The two lines you mention do not do the same thing. The shell script changes the current location, whereas the applescript line you mention only sets a variable. That variable does not actually change the location. The last line of the original script changes the location, and you'll notice that its quite a bit longer and requires that "Access for Assistive Devices" be turned on in Universal Access.

JP

---
Pell



[ Reply to This | # ]