raycast / extensions

Everything you need to extend Raycast.
https://developers.raycast.com
MIT License
5.37k stars 3.06k forks source link

[Set Audio Device]... #14203

Open prajat opened 2 months ago

prajat commented 2 months ago

Extension

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

Raycast Version

1.81.2

macOS Version

No response

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 D9 (/Users/magicpin/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:4:57)
    at /Users/magicpin/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:4:6400
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fa (/Users/magicpin/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:38:6806)
    at async N0 (/Users/magicpin/.config/raycast/extensions/2158713f-4712-4862-ba9a-3bce3cd07e3a/set-output-device.js:38:6981)

Steps To Reproduce

open raycast and run set output device to command

Current Behaviour

No response

Expected Behaviour

No response

raycastbot commented 2 months ago

Thank you for opening this issue!

πŸ”” @benvp @mathieudutour @mike182uk @FezVrasta @rcruzper @thomaspaulmann @arthur-fontaine @pernielsentikaer 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 close as not planned` Closes the issue as not planned. - `@raycastbot rename this issue to "Awesome new title"` Renames the issue. - `@raycastbot reopen this issue` Reopens the issue. - `@raycastbot assign me` Assigns yourself to the issue. - `@raycastbot good first issue` Adds the "Good first issue" label to the issue. - `@raycastbot keep this issue open` Make sure the issue won't go stale and will be kept open by the bot.
arthur-fontaine commented 2 months ago

You've been using GitHub for 6 years and you still don't know how to open a good issue... Please write more details than just "open raycast and run set output device to command". It works for everyone, we can't guess your special case that makes it buggy. For example, you can start by specifying your macOS version and rename the issue (not "...") πŸ™‚πŸ™‚πŸ™‚. Thanks.

prajat commented 1 month ago

You've been using GitHub for 6 years and you still don't know how to open a good issue... Please write more details than just "open raycast and run set output device to command". It works for everyone, we can't guess your special case that makes it buggy. For example, you can start by specifying your macOS version and rename the issue (not "...") πŸ™‚πŸ™‚πŸ™‚. Thanks.

Hey my bad, will raise as per it. thanks.