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 post

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 post

-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 post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...