Jump to content
tbnv

Connect to Bluetooth device

Recommended Posts

Hi,

 

Is there a way to have a workflow for connecting to Bluetooth devices? I have a Bose SoundLink Mini that I'd like my Mac to connect to, via Alfred. That would be much easier than via the Bluetooth menu.

 

Thanks!

Share this post


Link to post

It's actually really hard to to do. The only things that you can really do from the command line with bluetooth is to turn it on and off. You can do some UI scripting that will, essentially, actually, do all the clicking for you. You can look at this stackoverflow question to see some scripts.

Share this post


Link to post

This is something i have been looking for too. I have a bluetooth connect workflow, but being able to connect/disconnect to separate bluetooth devices would be great.

Share this post


Link to post

Apple has a nice utility to do this with Wifi connections, but there is no utility to do it with bluetooth connections. You can list devices with the blued command, but it doesn't allow you to connect / disconnect.

 

LightBlue is a python library for OS X to interact with bluetooth connections, but it was written for 10.8 and hasn't been updated in two years. Some people might be able to get it to compile on Yosemite by following the suggestions in this issue. I haven't tried to install it on Yosemite.

 

As I mentioned in the previous post, you can do this with UI scripting, but UI scripting is awful and not necessarily reliable. But, from everything that I've read, it's the only way to get it done. Look, again, at my previous post for a link with a sample script that will do the UI scripting for you. But there is no elegant way to accomplish this with a script filter that would check the individual devices on your computer.

Share this post


Link to post

Would love to know if there's any update on the potential to create a 'connect/disconnect' script for Bluetooth devices.

 

I've looked fairly extensively, and I know of no tools that let us interface with the bluetooth controllers at this level.

 

If someone has a good grasp of C and can parse through the lower-level bluetooth libraries, then they might be able to write a compiled tool that could do such a thing. Getting it to work across multiple versions of iOS and distribution would be a pain. The skill set is not one that I possess.

 

I wouldn't hold out much hope.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...