I was looking for a way to synchronize my mobile phone with iSync automatically every few hours. I already had an AppleScript which runs iSync, but I only wanted the system to attempt synchronization when the mobile phone is actually present on the Bluetooth network.
As I was planning to run this periodically as a Perl script from Tiger’s launchd, I needed a way to get the list of available Bluetooth devices on the command line. As far as I know, Tiger doesn’t have such a tool so I wrote one. It’s called “bluelist” and you can download it here. I put it into a bin directory in my home directory (~/bin/bluelist).
bluelist simply outputs a list of device names:
I use this list in the main Perl script which I store as ~/bin/isync.pl:
This invokes the following AppleScript, which I keep in ~/Library/Scripts/iSync.scpt:
And finally, to run it periodically, I use this launchd script which I store in ~/Library/LaunchDaemons/ch.entropy.isync.plist:
Update: Will Harris wrote an improved version of bluelist which also lists non-discoverable but paired devices. You can get it at http://will.harris.ch/bluelist.gz. Thanks Will :-)
Update: I realized that launchd’s StartCalendarInterval is broken. I switched to StartInterval:
Sure, you can get it from http://www2.entropy.ch/download/bluelist-src.tar.gz
You might also want to ask Will Harris for his version and merge all enhancements together before sending it back to me.
Hi there,
bluelist doesn't seem to stop searching on my MBP C2D. I think that's the reason, why the scripts don't start syncing my phone.
Can you help me on that?
Regs,
Nils
I have the same problem Nils has. My phone are found, but bluelist doesn't terminate.
Btw, Will Harris' version doesn't list my phones. Weird.
Weird indeed. I just tried to find out the cause with Nils, but so far no idea...
BTW I like your PDC installation instructions. I think I'll do that too :-)
Perhaps you could add something like a timeout to the program, so it stops when 1 minute is over?
PDC is a nice thing indeed. :)
After a couple of emails with someone who was trying to use my version of bluelist, I found that there is a problem with the internal run loop mechanism when a bluetooth connection is already active. In this case it turns out that the bluetooth polling loop never exits, causing the hangs some other users have talked about.
I have "hacked" a solution by using a timer in the run loop which also checks if the polling operation is finished, and stops the run loop manually. As with the original, the new version is on my site at http://will.harris.ch/bluelist.gz.
Cheers, Will
|



Just wanted to know if you would be willing to make the sources avaialable as I would like to add some functionality. Will send additions back to you.
Tnx & Bi
Bennie Kahler-Venter