Posts Tagged ‘OS X’

Enable system volume control for a generic USB device in Snow Leopard

This post is mainly targeted at people who have used an X-Fi USB audio card with their PCs on Windows or Linux. Many of us got a bad surprise when we plugged it into our shiny new Macs and we couldn’t even control the volume of the device through the system.

This particular problem is due to lack of dedicated drivers made by Creative. It seems that they only make OS X drivers for cards specially targeted at Macs.

Luckily there is a way to work around this limitation using a piece of software called Soundflower. The procedure is very simple, just follow the four steps here:

  1. Download and install SoundFlower (this might require a restart)
  2. Set Soundflower (2ch) as your audio output device (hint: you can option (⌥)-click your volume control icon in the menu)
  3. Launch Soundflowerbed (it was installed along with Soundflower)
  4. In the 2 channel device output options select your USB card.

And it is done, you can happily use your volume control buttons once again.

Set system output to Soundflower (2ch)

Set system output to Soundflower (2ch)

Set Soundflower output to your USB card

Set Soundflower output to your USB card

Global keyboard actions in Snow Leopard without third-party software

When I first got to use Mac OS X I have wondered whether it is possible to do stuff which I was used to do (more or less) easily on Linux. Among others there is the possibility to assign keyboard shortcuts to arbitrary actions (and especially shell scripts). I found several tutorials on how to do this, but they often include third party software like Quicksilver. Since I want to keep my system as vanilla as possible I was searching for a way to do it otherwise, and found it.

Introducing Services

Snow Leopard has this great thing called Services, which is a very simple to use way of creating very powerful actions in no time. Now, usually these are bound to a specific application or context, but they can be global.

Since it is much easier to explain something on an example, let us use a simple example. Following this article on how to pause iTunes for a short period of time.

Step 1:

  1. Open up the Automator.
  2. Create a New Service.
  3. In the ‘service receives selected’ drop-down box select no input in any application.
  4. In the left sidebar find Run AppleScript and drag it into the workflow
  5. Paste the code below on the place where it says (* Your script goes here *)
  6. Save the service as “Pause iTunes for 5 minutes”
tell application "iTunes"
    pause
    delay 300
    play
end tell

In the end the whole Automator window should look like this.

Automator service example

Automator service example

If you go to the current application’s menu now you should see your service in the Services sub-menu.

Step 2:

Now the only thing that remains is to add a keyboard shortcut for this service.

Open up System Preferences → Keyboard → Keyboard Shortcuts. In the left panel click on Services and then click on the + button under the right panel. In the following dialog choose:

  • Application : All Applications
  • Menu Title : Pause iTunes for 5 minutes
  • Keyboard Shortcut : F10

Following shortcut illustrates the result. Note that it is vital that the Menu Title chosen is exactly the same as the name under which you have saved the service.

Snow Leopard keyboard shortcut assignment

Snow Leopard keyboard shortcut assignment

All done, you can now enjoy launching your script anywhere, anytime by pressing F10.