Alan He Posted December 6, 2020 Share Posted December 6, 2020 (edited) ## Feat 1. switch audio 2. show current selected audio download link: https://github.com/alanhg/alfred-workflows/tree/master/switch-audio Edited December 7, 2020 by Alan He update snapshot Chris Messina and antkn33 2 Link to comment
Chris Messina Posted December 7, 2020 Share Posted December 7, 2020 How is this different than @mikegrb's Audio Device Workflow? Link to comment
Alan He Posted December 7, 2020 Author Share Posted December 7, 2020 (edited) 11 minutes ago, chris said: How is this different than @mikegrb's Audio Device Workflow? I took a look, and the underlying scheme used is the same. But I did something different, for example, I will prompt the currently selected audio. At the same time, I consider supporting AirPlay device support, of course it is not yet supported. Edited December 7, 2020 by Alan He Link to comment
Chris Messina Posted December 7, 2020 Share Posted December 7, 2020 Got it. And you're using Node and not Perl. I personalized the keywords to "output" and "input" (based on my muscle memory with the previous Workflow) and adjusted the text of the notifications to be a little clearer: Audio could not be switched to {var:device} Audio switched to {var:device} Thanks for sharing! Link to comment
Chris Messina Posted December 7, 2020 Share Posted December 7, 2020 @Alan He I tweaked index.js to add some context to each option (the line `title: "Switch to " + item,`), but I'm getting an empty row as a result. Any idea why? console.log( JSON.stringify({ items: audios .map((item) => item.replace(/(^(\n|\s)|(\n|\s)$)/g, '')) .map((item) => ({ title: "Switch to " + item, arg: item, subtitle: item === currentDeviceRes ? 'selected' : '' })) }) ); Link to comment
Alan He Posted December 7, 2020 Author Share Posted December 7, 2020 21 minutes ago, chris said: @Alan He I tweaked index.js to add some context to each option (the line `title: "Switch to " + item,`), but I'm getting an empty row as a result. Any idea why? console.log( JSON.stringify({ items: audios .map((item) => item.replace(/(^(\n|\s)|(\n|\s)$)/g, '')) .map((item) => ({ title: "Switch to " + item, arg: item, subtitle: item === currentDeviceRes ? 'selected' : '' })) }) ); some code missing cause code bug. I have update workflow, please update it. Thank you. I accepted your suggestion and revised the item's description. Chris Messina 1 Link to comment
Alan He Posted December 7, 2020 Author Share Posted December 7, 2020 I am considering supporting airplay devices, which not supported currently. Chris Messina 1 Link to comment
Chris Messina Posted December 7, 2020 Share Posted December 7, 2020 @Alan He Just spotted this workflow, might be of interest: https://github.com/Acidham/alfred-airpod-connector Link to comment
SJ2K Posted January 14, 2021 Share Posted January 14, 2021 This workflow doesn't seem to detect AirPods as a valid output option (even though they appear in the Sound preference pane) Alan He 1 Link to comment
Alan He Posted February 3, 2021 Author Share Posted February 3, 2021 On 1/14/2021 at 8:19 PM, SJ2K said: This workflow doesn't seem to detect AirPods as a valid output option (even though they appear in the Sound preference pane) That's true at the time, I'm thinking about updating it, but this needs to be investigated. Link to comment
Alan He Posted February 12, 2021 Author Share Posted February 12, 2021 (edited) @SJ2K I have updated the workflow. and it support AirPlay https://github.com/alanhg/alfred-workflows/tree/master/switch-audio Edited February 12, 2021 by Alan He Paulo and Chris Messina 2 Link to comment
bo9 Posted March 31, 2022 Share Posted March 31, 2022 Hello everyone. What is the simplest way to add this workflow? I am a beginner with all this, and I'd like to add this workflow, but I don't even know where to start. Link to comment
giovanni Posted March 31, 2022 Share Posted March 31, 2022 oh, you did ask about a specific workflow . Download the file named Switch Audio.alfredworkflow (screenshot below) and double click on it. Alan He and bo9 2 Link to comment
lvcasx1 Posted April 7, 2022 Share Posted April 7, 2022 Hi, just installed this workflow but when y type sound it just says: "waiting" and then just disappear and the only option is system preferences one. What should I do? anyone with this problem too? Link to comment
Chris Messina Posted April 12, 2022 Share Posted April 12, 2022 Open the Workflow in Alfred's Preferences, and click on the Bug to bring up the Console: Activate the Workflow from Alfred and if you see an error, share it with us here. Link to comment
fabio.velo Posted May 13, 2022 Share Posted May 13, 2022 Hello all, I always get the following error message:Scripts/9E568110-B58A-4AA5-B52E-B8D6B174F1E9:212:248: execution error: "System Events" received an error: osascript does not have permission for helper access. (-25211) Can someone tell me how to fix this error? Under Automation: osascript and Alfred are checked Also under accessibility: Automator, Terminal and Alfred. Thanks! Link to comment
Vero Posted May 13, 2022 Share Posted May 13, 2022 @fabio.velo Welcome to the forum You may benefit from resetting permissions, as macOS can sometimes lose track of the granted permissions, and going through the process again kicks it back into gear. Here are the steps to re-grant permissions: https://www.alfredapp.com/help/getting-started/permissions/#regrant Cheers, Vero Link to comment
DatPanda5 Posted October 7, 2022 Share Posted October 7, 2022 any way to switch both output/input to the same source in one entry? Link to comment
lwg Posted October 20, 2022 Share Posted October 20, 2022 Hi, Thank you for the nice work here. I have the same issue as: Quote Hi, just installed this workflow but when y type sound it just says: "waiting" and then just disappear and the only option is system preferences one. The console reads: [11:17:27.008] Switch Audio[Script Filter] Queuing argument '(null)' I did reset permissions, to no avail. Thank you for your assistance. Link to comment
abEnigma Posted October 25, 2022 Share Posted October 25, 2022 (edited) On 10/20/2022 at 12:26 PM, lwg said: Hi, Thank you for the nice work here. I have the same issue as: The console reads: [11:17:27.008] Switch Audio[Script Filter] Queuing argument '(null)' I did reset permissions, to no avail. Thank you for your assistance. started happening after upgrade to macOS 13 today. the output in debugger: [16:28:00.276] Switch Audio[Script Filter] Queuing argument '(null)' [16:28:00.459] Switch Audio[Script Filter] Script with argv '(null)' finished [16:28:00.464] ERROR: Switch Audio[Script Filter] Code 1: /Users/alexbnd/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E7A7EAD6-47A0-4D0E-A33B-93BD538DDB30:55:102: execution error: System Settings got an error: AppleEvent handler failed. (-10000) Edited October 25, 2022 by abEnigma Link to comment
vitor Posted October 25, 2022 Share Posted October 25, 2022 That’s because it tries to automate the System Preferences app, which is now System Settings which has poor AppleScript support. It’s helpful if you use the Feedback Assistant app and let Apple know you want AppleScript support in System Settings. The more people do it, the higher the chance it’ll be implemented. Link to comment
Tung Posted October 26, 2022 Share Posted October 26, 2022 I got the same problem as abEnigma. Wished i didn't upgrade to Ventura. This is my most used workflow in Alfred. Link to comment
Stephen_C Posted October 27, 2022 Share Posted October 27, 2022 I have a workflow which provides direct access to some of Ventura's System Settings (including Sound). You may find that useful as a temporary solution (although I know it's not a direct answer to your problem). Stephen Link to comment
vitor Posted October 27, 2022 Share Posted October 27, 2022 Alan may still update this to work on Ventura, but in the meantime there are other audio switchers you may try. They require installing extra software but don’t depend on automating System Settings. biker972 and cocoaaa 2 Link to comment
lwg Posted October 27, 2022 Share Posted October 27, 2022 On 10/20/2022 at 11:26 AM, lwg said: Hi, Thank you for the nice work here. I have the same issue as: The console reads: [11:17:27.008] Switch Audio[Script Filter] Queuing argument '(null)' I did reset permissions, to no avail. Thank you for your assistance. I am not on Ventura by the way, but Monterey. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now