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:
- iChat is not running
- iChat is offline
- There are no active network connections
- The script cannot determine an appropriate status message (no entry in table)
- The current status message is non-generic (Available, Away) and is not in the format used by the script. This is to allow you to set the message to something special (e.g. "At Lunch") and not have the script change it
Here's how to use the script:
- Using Script Editor, edit the list of properties at the beginning.
- Edit other properties
- Save the script as an application, making sure to check "Stay Open"
- Optionally, use Drop Script Backgrounder to prevent the script from showing an icon in the dock.
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.
- Add the script to your startup items (it's not much use if it's not running all the time)
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.
[robg adds: I haven't tested the script, but if you travel with your laptop, it could be quite handy. The source was originally included directly with this hint, but due to its length and formatting challenges due to some long lines, I chose to make it a separate download. Jason Snell of Macworld posted a different version in his Macworld Weblog a while back. I haven't compared the two to see how they differ...]

