Detect Bluetooth device
Is there a way to detect if a bluetooth device is connected and/or disconnected.
I found something here ( http://forums.macrumors.com/showthread.php?t=701524) but it is a little different than what I want.
Basically a script that can find out if a specified bluetooth device is connected. Then if it is, it does something. Then it checks every like 10 seconds or so to see if it is connected. Then if it is disconnected, it does something else.
The only issue I see is after it checks, it will run the same thing over and over. So there needs to be a way for it to check but after the first time it detects if a device is connected, it does not run that part over and over untill the device is marked as disconnected.
I know this is a lot so I can re explain but someone let me know if this is possible.
Mac Book Pro, Mac OS X (10.6.4)