-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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]... #11131
Comments
Thank you for opening this issue! 🔔 @benvp @mathieudutour @mike182uk @FezVrasta @rcruzper @thomaspaulmann you might want to have a look. 💡 Author and Contributors commandsThe author and contributors of
|
I add to the report that this error only happens if you have activated the Airplay option. Edit: The name of the Sound panel in macOS Ventura has changed to "com.apple.Sound-Settings.extension" and the legacy "com.apple.preference.sound" has been removed. To start, change that line in tell application "System Preferences"
- reveal pane id "com.apple.preference.sound"
+ reveal pane id "com.apple.Sound-Settings.extension"
end tell So it is returning without the Now all the |
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 😊 |
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. |
I tried it with Automators "Watch me do" (look here), and then with XCode's Accessibility Inspector (look here) and a lot of ChatGPT/Perplexity. I am currently stuck with this:
This snippet is not "done" and ready to be used, just my progress so far. Nevertheless, the execution of this Apple Script is INCREDIBLY slow (sometimes i takes 4 minutes in the Apple Script editor with 8 devices). I am not sure if there is any other way to manipulate and get the devices... just leaving my thought for now... And also i think this issue should be reopened, as it contains the most information about the problem (@thomaslombart), #10667 #10934 #12672 are duplicates in that sense... |
This could be interesting. The only downside is the need for a dependency |
@antonengelhardt I have no problem with this extension, it works fine for me |
Also with the AirPlay Setting turned on? |
I just tried that, I don't have AirPlay speaker, if you use AirPlay it doesn't work as you mention |
Yes, exactly. Actually you brought that up a few months ago. I just had the same problem and found this issue. I'm still trying to fix it... |
@antonengelhardt I was able to get an AirPlay enabled device to test. I also found 2 ways to get this to work, one using Swift with the Bonjour API and the other one using a command that comes in the system. Now I'm going to try to put the swift and applescript outputs together. Try if you can do something with the output of Commands: You can do something like this with applescript: |
@JoeRoddy Hey! Yeah, it's because airplay devices are now not accessible from applescript, you need to trigger this with an API. I'm trying to figure it out |
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 😊 |
Keep it open |
Patched getOutputDevices from me: set devices to {}
tell application "System Settings"
activate -- REQUIRED FOT AIRPLAY DEVICES
reveal pane id "com.apple.Sound-Settings.extension"
end tell
tell application "System Events" to tell application process "System Settings"
repeat until exists window "Sound"
end repeat
tell group 2 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Sound"
click radio button 1 of tab group 1
tell outline 1 of scroll area 1
set selected_row to (first UI element whose selected is true)
set currentOutput to value of static text of group 1 of UI element 1 of selected_row as text
repeat with r in rows
try
set deviceName to value of static text of group 1 of UI element 1 of r as text
set deviceType to value of static text of group 1 of UI element 2 of r as text
set end of devices to {deviceName, deviceType}
end try
end repeat
end tell
end tell
end tell
tell application "System Settings" to quit
return [devices, "currentOutput", currentOutput] This one works even without delay for me but System Settings app pop ups by this way. Probably can be avoided by changing focused app back to Raycast. set deviceNames to {}
tell application "System Events"
tell its application process "ControlCenter"
set soundMenu to menu bar item 5 of menu bar 1
click soundMenu
delay 0.5 -- WAIT FOR AIRPAY DEVICES TO SHOW UP
tell window 1
tell its group 1
set deviceElements to checkboxes of scroll area 1
repeat with deviceElement in deviceElements
set deviceMenuName to value of attribute "AXIdentifier" of deviceElement
set deviceName to text 14 thru -1 of deviceMenuName -- TRIM 'sound-device-' PREFIX
if value of attribute "AXValue" of deviceElement as boolean is true then
set currentOutput to deviceName
end if
set end of deviceNames to deviceName
end repeat
end tell
end tell
click soundMenu
end tell
end tell
return [deviceNames, "currentOutput", currentOutput] -- WITHOUT TYPE OF DEVICE (BUILT-IN, BT, AIRPLAY) But all of those solutions looks horrible, it would be much better to support it directly via coreaudio lib here: karaggeorge/macos-audio-devices#22 |
Hi! @pasteley 👋🏽 None of these solutions work for me at my local, how did u implement it? |
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 😊 |
Same, doesn't work here |
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 😊 |
keep it open |
Extension
https://raycast.com/benvp/audio-device
Description
Error:
Steps To Reproduce
error in "Set Output Device"
Current Behaviour
can fetch the output device in raycast
Expected Behaviour
get the existing output device
The text was updated successfully, but these errors were encountered: