Category Archives: Tools / Software

Switching your Mac’s audio output device with a keyboard shortcut

Here’s a typical scenario:

I’m writing an article, and I’m listening to music on Spotify over a bluetooth speaker that’s connected to my MacBook Pro. Suddenly, both my iPhone and Mac start to chime1. I have an incoming phone call.

When the phone rings I need to to two things under duress: put my headphones on and switch the audio output from the bluetooth speaker to the headphones. And I need to do this all before the call goes to voicemail. Seems simple enough. But it’s tougher than it sounds.

I know there’s a fast way to switch audio devices by Option-clicking on the volume icon in the menu bar and then choosing the audio device from the dropdown menu, and this sounds easy enough. But those menu bar icons are pretty small and there’s something about mousing under pressure that shoots my aim to hell. So this shortcut just isn’t a solution for me.

If I could create a simple keyboard shortcut that let me switch between all of my audio devices, that would be the best solution. But the question is, can I quickly switch between audio devices with a keyboard shortcut?

Using an applescript to set the audio device on a Mac

After a little googling, I found a simple, short applescript here, edited it a little to suit my purposes, and assigned it a keyboard shortcut to switch between the three audio output devices.

The applescript goes into the system preferences and picks the output device you indicate from the list of devices currently available. I’m sure that, in more skilled hands, this could all be done from a single instance of the script, but I chose to use 3 different versions of the script, each one indicating one of the three audio devices that I want to switch between.

#!/usr/bin/osascript

tell application "System Preferences"

reveal anchor "output" of pane id "com.apple.preference.sound"

end tell

tell application "System Events" to tell process "System Preferences"

tell table 1 of scroll area 1 of tab group 1 of window 1

select (row 1 where value of text field 1 is "Name-of-thing")

end tell

end tell

quit application "System Preferences"

Just edit “Name-of-thing” to the name of the device as it appears in the Sound preference pane, run it, and it will set that device as the current one.

Creating an audio output switcher shortcut with Keyboard Maestro

Next, I needed to set up keyboard access to this script. There are a number of ways to do this, Automator, Better Touch Tool, and others, but I chose to use Keyboard Maestro because it’s very powerful, very flexible, and I already use it to manage dozens of my shortcuts.

To keep the shortcut memory overhead to a minimum, I assigned all three scripts the same keyboard shortcut. In Keyboard Maestro, this pops up a palette with each of the actions listed. Just type the number that corresponds with the action’s position in the list. To make this easier, I number each of the items in the list. I then assigned CMD, OPT, CTRL, Shift + S (for ‘sound’) to this palette.

Step-by-step

Here’s a quick step-by-step walk thru of creating an audio output switcher with Keyboard Maestro.

  1. In a text editor, edit the applescript included in this article. Replace “Name-of-thing” with the name of the device exactly as it appears in the Sound Preferences pane.
  2. Create a new group in Keyboard Maestro called Audio Switcher
  3. Create a new shortcut in this group. Name it “1. name of your device”. Using a numeral will make this item appear first in the list, and will be a helpful visual cue for what number to hit when you summon the palette.
  4. Click the New Trigger symbol and enter your desired hot key trigger
  5. Click the New Action Symbol and search for Execute Applescript in the list of actions
  6. Keep the default options for the new action.
  7. Paste the edited applescript into the script field.
  8. Test the script.

Repeat for each device you have. I recommend using the same hot key trigger and using the palette to reduce the number of shortcuts you need to keep track of.

Links

Easy Audio Output Toggle Using AppleScript, Growl and Quicksilver

Keyboard Maestro

  1. I use Continuity to make and take calls on my computer. Since my co-workers use a range of technologies for voice and visual communication, it’s incredibly convenient to use a single device, my Mac, for all of it. A single device, a single set of headphones with a mic.
Advertisements

Wordnik.com is better than the dictionary.

I just found out about this site called Wordnik, and it is now the place that I will go to find my words, to define my words, and to learn new words.

Stick your word in the search field and Wordnik will go to work for you.

It'll give you the definision of a word from several different online dictionaries and encyclopedias and other collections of lexcical1 information.

Hyponyms? Hypernyms? Wha??

Some of these things I did't know what they were, but now that I know about them, hell yes I want them in my fricking dictionary! Why weren't they there before?

Synonyms, hyponyms, hypernyms, rhymes. Words that are found in similar contexts. Examples of the word in use. All very useful to have available when doing some serious word work.

And a great resource, the Reverse Dictionary which I used to look up what the study of insects in order to distiguish between Entymology and Etymology, the study of the history of words. Two words I confuse often.

This is now the place that I go to find my words. Incredible free resource.


Wordnik via some link blog that I can't remember now.

  1. A word that I had to look up to make sure it actually existed and meant what I thought it meant.

Oak Outliner

I do a lot of thinking in outlines, and I’ve used quite a few outliner apps in my time as a computer user and thinker of things.

My favorite for ease of use is OmniOutliner. I can just fill up line after line in that app. But the problem occurs when it’s time to get those lines out of the app. There’s no smooth way to get them out. Not that I’ve found.

There’s the OPML export, there’s the copy and paste, there’s dragging them from the app into the window of another app, but time and time again, I run into the same problem that I can’t get the stuff out of that outline without having to go back and be on the hook for a lot of fiddly clean up of odd carriage returns and spacing, extra characters that show up in export because I forgot to turn off the checkbox feature. Things like that.

It’s possible to get the stuff out, but the cost of cleaning it up outweighs the savings in using the app over using a text file or doing it right in a word processor.

Oak Outliner is weird in that it is a web-based application1 that stores your outline in the browser’s cache. That means it stays where it is, no syncing, no saving. Lots of neat features like intuitive keyboard shorties and folding of lines.

I think it’s pretty slick, just like I think another project made by these guys, Folding Text is chock full of interesting potential. And maybe for a quick one-off brainstorming session Oak Outliner might be really handy. But I’m struggling to think of a reason why I’d use this over a text editor, or Scrivener, or a native app.

I will be keeping an eye on this though.


Oak Outliner

Folding Text

OmniOutliner


  1. There are tons of these things popping up now. Checkvist, Fargo along with Oak are the newest and fanciest, I think.  ↩

Prelude to Paperlessness

My wife just decided to buy a document scanner for her business

Very excited, because I’ve been wanting to go paperless in my office, but my flatbed scanner broke long ago, and since then, I’ve been using an app called Scanner Pro that uses the camera to make scans of documents. It’s surprisingly usable, and great for one-off scans, but anything more than one or three pages, and you’re going crazy. So tackling the scanning of all the paper in my filing cabinet was simply not an option.

It will likely be a while before I’m able to make good on my vow to go paperless, but I’m sure excited.

I’m preparing myself, too. David Sparks’ book Paperless has been a pretty thorough guide for how to get started.


Fujitsu ScanSnap S1300i Sheet-Fed Mobile Document Scanner

Paperless – David Sparks

Using Textexpander to quickly create Amazon affiliate links

When I was actively producing The Winchcombe, I made a little bit of money from the Amazon Affiliate Program link that I stuck on there.

It’s a nice, easy way for readers to give a little bit of money to a content producer that they like without it actually costing anything, other than an extra click or two.

And I’ve stuck a few in this blog from time to time as well. But the actual generation of the link back to a produce had always been just difficult enough to keep me from doing it as often as I’d like to.

But recently I discovered that TextExpander can do it for you, if you create a snippet featuring a nifty little script that a guy named Brett Kelly made. Then, just plug in your affiliate code and an abbreviation and you’re ready to roll.

And, as a bonus, you can learn a little bit about how it works in Brett’s post about it.


TextExpander

How To Use A Textexpander Snippet To Quickly Generate Amazon Affiliate Links

Fast actions with Drafts for iOS

I’m not sure that I get the most out of this iPhone app, but if I based satisfaction on maximum usage of available features, then I think I’d be pretty disappointed with a great many things in my life.

Drafts is an iOS app developed by Agile Tortoise with separate versions for iPhones and iPads, which is always a point of friction for the frugal iOS device owner. But still inexpensive for what it can do. $2.99 for iPhone and $3.99 for iPad.

From Agile Tortoise:

Drafts is a different kind of note taking app. In Drafts, text comes first – open the app and get a new, blank draft. Don’t get bogged down in a timeline to tweet or post to Facebook and App.net. Don’t tap through multiple screens to compose an email or SMS. Don’t navigate folders, create files and name them just to jot down a note or create a todo. Drafts is available for both iPhone and iPad.

The cool kids love this app, and I can see why. There are tons of chutes that fire out of Drafts and into other apps or services like Mail, Dropbox, and Evernote, plus it can take advantage of the URL schemes that allow even more interoperability with stuff on your phone. Appending and prepending to text files, sending emails, creating calendar items using Fantastical’s natural language support. It is a fiddler’s dream.

However, I’m not a fiddler.

I use Drafts for two things:

  1. I use it as a front end to OmniFocus to capture stuff as it occurs to me, because the app launches fast and is ready to type in immediately.

  2. I use it to type up and then fire off a Google search to Safari, because it’s such a pain to tap in the search field in Apple’s browser.

And that might seem a bit light on use cases, but Drafts lives in my phone’s dock. So that might illustrate what I do most commonly.

I’m glad that there are so many hooks and pathways from Drafts into other apps, but I find that at this point in my iPhone usage, I just don’t have that many apps that I use that benefit from a blank canvas before they actually become useful. Maybe that speaks to the design of the apps that I use, or the ways in which I use them. Maybe if circumstances change, I’ll be better able to take advantage of all that Drafts has to offer, but for now, I’ll keep it simple.

Drafts does simple pretty well, too.