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:

http://www.alfredforum.com/index.php?/topic/5-generating-feedback-in-workflows/

 

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

http://mikegrb.com/2013/01/18/alfred2-audio-device/

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:

AirPlay

… 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.

Guest
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...