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


Click here to return to the 'Easier switch and a Growl notification' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easier switch and a Growl notification
Authored by: gabrielradic on Jan 17, '06 03:05:50AM
I use this AppleScript to switch the location and send a Growl notification:

set theLocation to "Automatic"
-- use this variable so to easily duplicate the script for other locations

tell application "Finder"
	do shell script "scselect " & theLocation
end tell

-- this is about it for the location switch
-- the rest is for the Growl notification

tell application "GrowlHelperApp"
	set the allNotificationsList to 
		{"Switch Network Location"}
	set the enabledNotificationsList to allNotificationsList
	register as application 
		"Butler" all notifications allNotificationsList 
		default notifications enabledNotificationsList 
		icon of application "Butler.app"
	
	notify with name 
		"Switch Network Location" title 
		"Network Location" description 
		"Switched to " & theLocation application name "Butler"
	
end tell
Then you can create a custom item in either Butler (highly recommended over QS) or another launcher. You may need to adjust the script for other launchers.

[ Reply to This | # ]