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: 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 | # ]