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


Click here to return to the 'Set iChat status by Network Location (revisited)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Set iChat status by Network Location (revisited)
Authored by: cyberhomie on May 14, '04 12:26:29PM

How about a script that changes the status base on the Network System Preferences' Location. I have different Locations set up for different places, ie @Home, @Work @the Parents, On the Road (using my bluetooth phone), different dialup providers, access numbers, etc. I would be nicer/easier/smarter for me to set status based on the OS' Location feature.

Any suggestions?



[ Reply to This | # ]
Set iChat status by Network Location (revisited)
Authored by: cyberhomie on May 14, '04 12:33:13PM

Ooops -->

"..the status base on the.." - the status base[d] on the

"I would be nicer..." - I[t] would be nicer (yeah it not I, well maybe I would be nicer, too)



[ Reply to This | # ]
Set iChat status by Network Location (revisited)
Authored by: mattshep on May 14, '04 03:13:15PM

You can make some minor adjustments to my posted script and get it to search based on location. Just add a LocationName property to the Network. The key line is determining what the current network location is. I think this should work.

[code]
set LocationName to do shell script "scselect 2>&1 | grep '^ ' 2>&1 | grep '*' | cut -f 2 -d '(' | cut -f 1 -d ')'"
[/code]



[ Reply to This | # ]
Set iChat status by Network Location (revisited)
Authored by: cyberhomie on May 14, '04 03:54:25PM

Can't seem to get it to work.



[ Reply to This | # ]
Set iChat status by Network Location (revisited)
Authored by: mattshep on May 14, '04 08:43:59PM


property Locations : {"Home", "Work", "Automatic"}
property Messages : {"@home", "@work", "?"}

tell application "System Events"
	
	set Location to do shell script "scselect 2>&1 | grep '^ ' 2>&1 | grep '*' | cut -f 2 -d '(' | cut -f 1 -d ')'"
	
	repeat with i from 1 to count of Locations
		if Location is item i of Locations then
			return item i of Messages
		end if
	end repeat
	
	return "Error: No match"
	
end tell



[ Reply to This | # ]