Proximity →

Proximity monitors the proximity of your mobile phone or other bluetooth device and executes custom AppleScripts when the device goes out of range or comes into range of your computer.

Via this Mac OS X Hint, which includes sample AppleScripts.