Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'd like a quick way to start tethering using my iPhone, hopefully just using the keyboard. Using the bluetooth menu, I can choose the Connect to Network option in the submenu for my device, but is it possible to automate this?

Ultimately I want to assign this to a shortcut in (the very awesome) Alfred.app, but anything using the command line or AppleScript will work.

Is this possible? Thanks!!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

It doesn't look like there is a direct AppleScript dictionary for working with Bluetooth this way.

You could use GUI scripting though, which basically uses the accessibility feature of the Mac OS to select menu items, etc.

A great writeup on how to start with GUI AppleScript is available on MacOSAutomation.com.

GUI automation can be difficult if you have a constantly changing list of things, but if you commonly have a list of bluetooth items connected that stays the same you should be ok.

You could then call this AppleScript through Alfred.

share|improve this answer

I would recommend using automator for this, you can call it from Alfred to make it easy :)

My current automator workflow does this:

Click the "bluetooth" menu bar item.
Connect to Network

Using this method you can automate almost anything within a minute

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.