Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
"Select audio output" applescript?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sherfick" data-source="post: 1239559" data-attributes="member: 202263"><p>I'd like a keyboard shortcut that will select the "HDMI" audio output without going through the menus when my mac is connected to my TV. I tried to find a script or something to enter into Quicksilver for this, and this is what I came up with:</p><p></p><p>tell application "System Preferences" to activate</p><p>tell application "System Events"</p><p> get properties</p><p> tell process "System Preferences"</p><p> click menu item "Sound" of menu "View" of menu bar 1</p><p> delay 2</p><p> set theRows to every row of table 1 of scroll area 1 of ¬</p><p> tab group 1 of window "sound"</p><p> set theOutputs to {} as list</p><p> repeat with aRow in theRows</p><p> if (value of text field 1 of aRow as text) ¬</p><p> is equal to "HDMI" then</p><p> set selected of aRow to true</p><p> exit repeat</p><p> end if</p><p> end repeat</p><p> end tell</p><p>end tell</p><p>tell application "System Preferences" to quit</p><p></p><p>Problem is, I have hardly any clue what this means or how to make a script for it. Also if someone could tell me how to add the script to Quicksilver? I found the actions folder and it's just a bunch of words, do I just paste the script in that folder?</p><p></p><p>Thanks</p></blockquote><p></p>
[QUOTE="Sherfick, post: 1239559, member: 202263"] I'd like a keyboard shortcut that will select the "HDMI" audio output without going through the menus when my mac is connected to my TV. I tried to find a script or something to enter into Quicksilver for this, and this is what I came up with: tell application "System Preferences" to activate tell application "System Events" get properties tell process "System Preferences" click menu item "Sound" of menu "View" of menu bar 1 delay 2 set theRows to every row of table 1 of scroll area 1 of ¬ tab group 1 of window "sound" set theOutputs to {} as list repeat with aRow in theRows if (value of text field 1 of aRow as text) ¬ is equal to "HDMI" then set selected of aRow to true exit repeat end if end repeat end tell end tell tell application "System Preferences" to quit Problem is, I have hardly any clue what this means or how to make a script for it. Also if someone could tell me how to add the script to Quicksilver? I found the actions folder and it's just a bunch of words, do I just paste the script in that folder? Thanks [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
"Select audio output" applescript?
Top