There are plenty of scripts to set your iChat status according to what music you're listening to and whatnot. However, since I have a laptop, I find it more useful to set my iChat status message according to where I am at the time (e.g., work, home, cafe down the street). This helps to let people know if it's an appropriate time to message me or not. After a while, I found that I often forgot to change my status accordingly, and I would be advertising that I was at work when I was in fact home or vice-versa. It occurred to me that it was possible to divine this information based on my network connection, so I wrote a daemon script to update my iChat status automatically.
Here's how the script works. Locations can be distinguished by an IP address prefix (subnet), or wireless SSID (the name displayed in the airport menu). The script first checks to see if there is an active wired connection. If so, the status message is set based on a table of names and subnets that the user of the script must create. If there is no wired connection, but wireless is active, the same table is checked for matching subnets and SSIDs. If none are found, then the SSID itself is used. If the script is successful, the iChat status message will be set to "@locationName" for known wired locations, "802.11@locationName" for known wireless locations, and "802.11@SSID" for unknown wireless connections. To help you know its working, the script uses AppleTalk to say "Changing iChat message status" when there is a change.
There are a number of situations that the status message will not be changed:
Here's how to use the script:
A location can be defined by the ssid and/or subnet fields, but must define a statusMessage field. The subnet field can be a complete IP address if desired, since the script just does substring matching. Make sure to add any new location properties to the localeTable property, or they won't be found.
Two simple ones are idleTimeout and changePhrase. Making changePhrase "" is an easy way of shutting the script up. It's also relatively straightforward to change the scripts conventions about "802.11" and "@", but if you don't know what you're doing, it may mess things up.
This is a nice way to remove clutter once you're happy with the way the script works, but you'll have to rerun this utility every time you change the script, so keep it around.
Mac OS X Hints
http://hints.macworld.com/article.php?story=2004041213242778