Jump to content

Next Audio Output Device + request for help!

Recommended Posts

This is absolutely possible - You'll just need to use a Script Filter as your first item instead of Keyword, and then write a script to grab which is the active output and print the appropriate XML to display the info in the subtitle.


See the following thread for details on passing feedback back to Alfred:



Also, take a look at Mikegrb's Audio Device Selection workflow, which will likely do what you want already.


Link to comment

I don't know Ruby at all, but it shouldn't be too difficult.


Looking at the documentation:


"SwitchAudioSource -c" shows the current device

"SwitchAudioSource -a" shows all devices


Assuming the -n flag just chooses the next device in that list, you could easily just load the names generated by "-a" into an array. Then it's just a simple compare to find which array index matches the current device, say "n", and then print "n+1" as the next device.

Link to comment

-a outputs more along the lines of:

Built-in Microphone (input)
Built-in Output (output)
AirPlay (output)

Whereas -n outputs just:


… for example. I would need to trim the " (output)".


If you could provide an example of how to do this, it would be appreciated. My knowledge of Ruby sucks (I never code in Ruby!).


Edit: just seen you don't know Ruby either. I'll ask on IRC :P

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...