Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Set Audio Device] does not fetch device list when "include Airplay devices" is enabled #10934

Closed
ghost opened this issue Feb 24, 2024 · 10 comments
Labels
bug Something isn't working extension: audio-device Issues related to the audio-device extension extension Issues related to one of the extensions in the Store status: stalled Stalled due inactivity

Comments

@ghost
Copy link

ghost commented Feb 24, 2024

Extension

https://raycast.com/benvp/audio-device

Description

Error:

Error: Command failed with exit code 1: osascript -e 
    set devices to {}

    tell application "System Preferences"
      reveal pane id "com.apple.preference.sound"
    end tell
    tell application "System Events"
      tell application process "System Preferences"
        repeat until exists tab group 1 of window "Sound"
        end repeat
        tell tab group 1 of window "Sound"
          click radio button "Output"
          tell table 1 of scroll area 1
            set selected_row to (first UI element whose selected is true)
            set currentOutput to value of text field 1 of selected_row as text
            
            repeat with r in rows
              try
                set deviceName to value of text field 1 of r as text
                set deviceType to value of text field 2 of r as text
                set end of devices to { deviceName, deviceType }
              end try
            end repeat
          end tell
        end tell
      end tell
    end tell

    if application "System Preferences" is running then
      tell application "System Preferences" to quit
    end if
    
    return [ devices, "currentOutput", currentOutput ]
   
64:116: execution error: System Settings got an error: Can’t get pane id "com.apple.preference.sound". (-1728)
    at _t (/Users/pottersfield/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:5:57)
    at /Users/pottersfield/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:5:6400
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ca (/Users/pottersfield/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:41:6806)
    at async b0 (/Users/pottersfield/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:41:6981)

Steps To Reproduce

Enable "Include AirPlay devices" in settings and you get the error message.
Disable "Include AirPlay devices" in settings and it works, but only shows generic "AirPlay" when current connected device is an AirPlay device, but no name.

https://github.com/alanhg/switchaudio-osx commit on switchaudio-osx seems to fix the AirPlay issues.

Current Behaviour

No response

Expected Behaviour

No response

@ghost ghost added bug Something isn't working extension Issues related to one of the extensions in the Store labels Feb 24, 2024
@raycastbot raycastbot added the extension: audio-device Issues related to the audio-device extension label Feb 24, 2024
@raycastbot
Copy link
Collaborator

Thank you for opening this issue!

🔔 @benvp @mathieudutour @mike182uk @FezVrasta @rcruzper @thomaspaulmann you might want to have a look.

💡 Author and Contributors commands

The author and contributors of benvp/audio-device can trigger bot actions by commenting:

  • @raycastbot close this issue Closes the issue.
  • @raycastbot rename this issue to "Awesome new title" Renames the issue.
  • @raycastbot reopen this issue Reopen the issue.

@pointbreakd
Copy link

Still an issue.

@theomax13
Copy link

Same here still not fixed

@ghost
Copy link
Author

ghost commented May 13, 2024

I personally switched to Keyboard Maestro macro which I can configure to switch to specific AirPlay devices. This works for weeks/months now flawlessly.

https://forum.keyboardmaestro.com/t/macro-set-sound-output-v7-1/23959

@raycastbot
Copy link
Collaborator

This issue has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Jul 2, 2024
@raycastbot
Copy link
Collaborator

This issue has been automatically closed due to inactivity.

Feel free to comment in the thread when you're ready to continue working on it 🙂

You can also catch us in Slack if you want to discuss this.

@raycastbot raycastbot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
@Bonapara
Copy link

Same here

@Ptujec
Copy link

Ptujec commented Jan 30, 2025

@benvp If you are interested, I have a working AppleScript for the AirPlay part in my LaunchBar action.

@abraver
Copy link

abraver commented Feb 23, 2025

+1

1 similar comment
@LuckyTheCoder
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working extension: audio-device Issues related to the audio-device extension extension Issues related to one of the extensions in the Store status: stalled Stalled due inactivity
Projects
None yet
Development

No branches or pull requests

7 participants