Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've an iMac running Snow Leopard & I'd like to activate the internal Airport via Speech Recognition. I imagine a script would be involved but I've never utilized one before. Also I'm interested in an auto-generated log of when the Airport is on.

share|improve this question
    
If my answer helped you, please accept it. If not, please comment on what's missing. Thanks! –  Daniel Beck Oct 26 '10 at 13:57
add comment

1 Answer

The command line way to control Airport is networksetup.

Typing networksetup | grep airport in the Terminal reveals:

Usage: networksetup -getairportnetwork <device name>
Usage: networksetup -setairportnetwork <network> <device name> [password]
Usage: networksetup -getairportpower <device name>
Usage: networksetup -setairportpower <device name> <on off>

So this is what you want for controlling AirPort.

Wikipedia says:

Mac OS X v10.4 added Automator workflows which can also be used as Speakable items.

If a workflow is saved as an application and put in the Speakable items folder it becomes available to the speech recognition software. The words the computer will recognize to execute the command will be the name of the saved Automator application. Some words might have to be misspelt for the computer to know the proper pronunciation. (For example, the computer best recognizes "Les Misérables" as Lay Mizzer Ob).

You can determine the location of speakable items by going to System Preferences, Speech, Speech Recognition, Open Seakable Items Folder. For me, it's /Users/username/Library/Speech/Speakable Items

Create an Automator application using the Run Shell Script item, call networksetup with appropriate parameters (e.g. networksetup -setairportpower en1 on for enabling), save it as an application, store it in the speakable items directory determined above. Use the command you want to speak as application name.

Edited to add:

Here was another answer previously regarding the log. I think it refered to /private/var/log/kernel.log.

Grep AirPort (or type AirPort in the Console.app search box after selecting kernel.log under /private/var/log in the tree on the left) and you should see corresponding log messages, including

AirPort: Link Down on en1. Reason 8 (Disassociated because station leaving).

or

AirPort: Link Up on en1

share|improve this answer
add comment

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.