Changing sound preferences - Applescript

Hi there,
I want to change Sound Input and Sound output settings in System preferences to my Bluetooth headset (Logitech HS04 V01) and back. By one click. I did not found any system option to do it, but there should be the way to do it with applescript.
What I found and modified is this script:
<pre>
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 3
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 "Logitech HS04 V01" then
delay 1
set selected of aRow to true
exit repeat
end if
end repeat
end tell
end tell
tell application "System Preferences" to quit
</pre>
It changes sound output to my Bluetooth headset. But only the output and only one way. How to improve it? How to extend it to change both input and output?
Jirka
iBook G4   Mac OS X (10.4.5)   1.33 GHz, 512 MB, 12-inch

Some additional details:
- If I change my sound settings to internal speakers while the USB device is connected they do change, however if I unplug the USB device and plug it back again they changed again to USB device (so it hasn't saved my settings for the USB device).

Similar Messages

  • Changing sound preferences doesn't work until I restart?

    So the new mail sound for a particular mail account, I want to change. I change it to "off" (no sound) and when I get an email it still makes the sound it used to. If I restart the phone then it works correctly and I won't hear a sound when I get a new email. Is this how it should work? Changing a setting in preferences doesn't work till you restart the phone?

    Well, the 'chirping' certainly isn't a hard drive! I don't know what it could be... the only thing that I can suggest is that you take your computer to your local Apple Store and have them diagnose the problem. The diagnosis should be free as will an estimate for repair (if you're out of warranty).
    Something's obviously not right but as the only moving parts in the retina models are the fans, you may have a problems with the fans. As to the problems with the keyboard, let the Apple techs figure that one out.
    Good luck,
    Clinton

  • How do I turn off vibrations when changing sound preferences?

    I recently changed from syncing from my iphone to my computer to syncing it to icloud.  Well it reset all my settings upon both syncs and now it vibrates every time I change a tone of some sort.  I gone into my settings and have the vibrations turned off under sounds, yet it continues to vibrate whether I have the phone on silent or otherwise. It is very annoying.  Please help Apple community! What can I do to get these vibrations to turn off completely?  I never want the phone to vibrate.

    Someone else reported this sound last September, but there wasn't any resolution to that thread: [https://support.mozilla.org/en-US/questions/938003 After upgrading to Snow Leopard on my Mac, Firefox makes typewriter or paper crinkling sounds when going to links and sites].
    Does it seem to be at all related to whether pages use Flash? Just wondering whether it is some kind of notification sound related to Flash's capabilities of using the webcam and microphone.

  • Automator and sound preferences

    Imac Mac OS X (10.4.9)
    Is there any way set up an automator script (or Apple script) to change sound preferences. Example, change from Imic output to headphone output, turn off and on Isub. Any help would be appreciated.

    Furthermore, I came across this applescript in forums which appears to do switching, it opens the preference panel and selects sound but then stops with the fault.
    System Events got an error: NSReceiverEvaluationScriptError: 4
    I don't understand the script language yet as I am new to automator and apple script.
    i need to switch between imic output(with sub off) and headphone output (with sub on)
    Also whats the best place to learn apple script language?
    tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.sound"
    end tell
    tell application "System Events"
    tell process "System Preferences"
    click radio button "Output" of tab group 1 of window "Sound"
    repeat until (value of radio button "Output" of tab group 1 of window "Sound") is 1
    end repeat
    if (selected of row 1 of table 1 of scroll area 1 of tab group 1 of window "Sound") is true then
    select row 2 of table 1 of scroll area 1 of tab group 1 of window "Sound"
    repeat until (selected of row 2 of table 1 of scroll area 1 of tab group 1 of window "Sound") is true
    end repeat
    else
    select row 1 of table 1 of scroll area 1 of tab group 1 of window "Sound"
    repeat until (selected of row 1 of table 1 of scroll area 1 of tab group 1 of window "Sound") is true
    end repeat
    end if
    end tell
    quit
    end tell
    Imac Mac OS X (10.4.9)
    Imac Mac OS X (10.4.9)
    Imac Mac OS X (10.4.9)

  • Changing OSX default volume setting to a higher level in sound preferences

    When I change the default volume setting to a higher level in sound preferences within OSX, it is back at the lower level at the next listening session the following time I use iTunes on my Mac Mini. Within System Preferences there is a section that lets you "choose a device for sound output" but the only choice I have is "line-out" and under the "port" heading there is only "built-in output"--no other choices are shown. I have external speakers attached which I like to use for listening to music as I work. What is the problem? Why won't the higher volume I set remain? Also, shouldn't more than one choice be shown for sound output?

    This sounds like the problem that I'm experiencing and <a href-"http://discussions.apple.com/message.jspa?messageID=2694517#2694517">aske d about a couple of days ago. The sound level resets to 50% after shutdown.
    I tried setting the levels in Audio MIDI Set Up as suggested above, but that hasn't changed anything.
    In answer to B_web, I am running my external speakers through the headphone jack.
    So, any other suggestions?

  • My MacBook Pro has no audio.  Sounds preferences showing output is Optical digital-out port.  How do I change this to built-in speakers?

    My MacBook Pro has no audio.  Sounds preferences showing output is Optical digital-out port.  How do I change this to built-in speakers?

    I experienced this same problem yesterday on my MacBook Pro,  still searching for a solution, several other posts here indicate people have been experiencing this since at lease 2007.  I have  yet to find a clear solution. 
    It appears that occasionally inserting headphone causes this, it turns on the Optical digital-out port feature (red light glows inside the headphone port) and takes away the internal speakers option.   Restarting did not restore it, but for some reason after sitting asleep overnight the sound started working again and the internal speaker option return in the Sound - Output Window, and the Optical Digital-out option went away. 
    Here is another post with some ideas on this 
    https://discussions.apple.com/message/4160477#4160477

  • Garage Band,  I am using an MBOX with a digi design audio core as a mic interface to recod into Garage Band.  Now when I Change the preferences to use the MBOX I can not move the recorder slider and there is no sound going into garage band?  Any solutions

    Garage Band,  I am using an MBOX with a digi design audio core as a mic interface to recod into Garage Band.  Now when I Change the preferences to use the MBOX I can not move the recorder slider and there is no sound going into garage band?  Any solutions

    10.5.8 with latest garageband 5.1 with MBOX 1. On Nov 4.09 I did a software update, now i get no output volume or input volume to the computer itself. I get it from head phones from my mbox, but not to the computer. Before the software update It worked great. I've tried upgrading software through digidesign .com, but they dont seem to have one for what i need. any way to get my old garage band back? go from 5.1 to earlier? Or maybe it was the upgrade to 10.5.8. update? Can i go back in time lol?
    Any help would be appreciated
    BTW
    Ive tried all the system sound prefs, and garage band drivers. Back and forth.
    cheers
    ds

  • Use Automator to Change System Preferences?

    Hi. I want to create a workflow or applescript that will open my system's sound preferences and change the output source. The Applescript editor doesn't record any of my actions.

    Modify the setting from System Preferences, and then look for plist files in ~/Library/Preferences/ and /Library/Preferences/ modified around that time. When you've located a possible plist, open the Terminal application in the /Applications/Utilities/ folder and enter 'defaults read ' without the quote marks. Drag the plist into the Terminal and press Enter; you will then see a list of keys. If a key looks like it contains what you're looking for, remember its value, change the setting again from System Preferences, and check the key again. Once you've found the key, you can use a 'defaults write' action in Automator's shell script option to change the value. If you can't write the key successfully, post back here with the name of the key and where you found it for further assistance.
    (12421)

  • Sound Preferences: switches from Internal Speakers to Digital Out

    I've been having this problem recently. I sent the computer off to Apple a few weeks ago and it helped for a while, but no longer.
    My computer has a problem with it's sound output jack or something. Without inserting anything into the plug, the Sound will change for "Internal Speakers" to "Digital Out" and to "Built-in Output" in the Sound Preferences Panel.
    Any suggestions?
    Message was edited by: davidszcz

    I have a 4 month old macbook and experiencing the same problem. Just realized it after installing itunes 8 and since then having a stuttering audio playback problem too. When i plug my headphones into the audiojack the sound switches from headphones to speakers and back as well as itunes playing tracks in a stop and go mode. I repaired the rights several times, installed quicktime 7.5.5 again, reinstalled itunes 8 and for sure running the latest leopard version 10.5.5.
    Also thought it could be a hardware problem but after reading this it seems more software related.
    Any idea?

  • How to change sound output?

    Howdy
    I recently bought a high-end toslink cable which I connected from the optical/digital out from my iMac to my receiver. The sound quality is excellent, however I noticed that all sounds now gets passed to my Hifi system all the time. The only way (I could find) to route sound to the internal speakers is by physically unplug the cable. This is really not workable in the long run as it wears down the plug and, not to mention, my patience...
    So, anyone know any way to switch output to internal speakers w/o having to unplug the cable? Or is there another approach (I'm thinking Airport Express)?
    /Cheers

    Unfortunately, you cannot select +Internal speakers+ in System Preferences Sound pane Output tab, if you have something plugged into the audio output port.
    If you got an AirPort Express, its AirTunes feature would certainly work for iTunes output. However, I believe AirTunes would only play the output of iTunes. So it would work great as long as you were only playing songs and videos using iTunes, because all other sounds will come from your computer speakers. No need to change any setting manually, after you are done listening over the stereo system. However, it would not work so great, if you wanted the audio output of some other programs to be played from the stereo system; but there seems to be a third-party solution for that issue
    http://www.rogueamoeba.com/airfoil/mac/
    If you have separate powered computer speakers that connect using a standard mini-jack, one alternative is to get a USB (or possibly FireWire) sound output device (if you want to be able to change the sound output setting manually). The least expensive one may be the Griffin iMic.
    http://www.griffintechnology.com/products/imic/
    It provides a second sound output port over USB, so it should show up as a separate choice in System Preferences Sound pane Output tab. Therefore, you should be able to use the Sound preference pane to manually switch the sound output from you stereo system to the computer speakers connected over the USB iMic.

  • Volume change sound effect won't stop

    So I changed my preferences and unticked the "Play feedback when volume is changed" option. Basically all is good for a while then a week or two later I'll realise the sound effect is back when I change the volume. But the option remains unticked in preferences.
    Anyone else having this problem?

    Simple, the device even if off can pick up signal noise from any other device or items. Stereo speakers have in the past gave off a whirl sound from radio stations, police and cb radios, high frequency pick up is not unheard of. There are cases where radio receivers have picked up cross talk while off.
    With computers broadcasting on the 2.4 and 5.0 frequency many times microvave ovens, other electrical items can cause the sound the original poster complains about. (Chirping) Cell phones are just radio transmitting and receiving devices.
    You don't need a 500 foot antenna to pick up sounds. Even if the phone is off it has an internal antenna.
    interference is quite possible, and frankly there are not many people posting about radio chirping to believe its nothing but interference .

  • Sound Preferences Problem

    My USB Headset shows up twice for both the input and output in the Sound Preferences panel.
    If I disconnect it from my hub, one entry disappears from the list but the other one remains.
    It works for most things when I select the right one from the list, but I use the speech recognition program iListen and I can't get that program to work no matter which one I choose using the 'Set Up My microphone' menu command.
    I have created another user to see if that would fix the problem but that didn't work either.
    I have looked for any prefs files that I could delete and can't find anything.
    Is there a program that will let you remove items from the Sound prefs pane?
    Does anybody have any suggestions on how to fix this problem?
    I am handicapped and I rely on that program a lot. Thanks

    I thought those prefs were in the following file, but if another user didn't change it at all then must not be...
    Users/nnnn/Library/Preferences/ByHost/com.GlobalPreferences.(12 digit number).plist
    So, I'm gonna guess dragging this file to the Desktop & rebooting...
    /Library/Preferences/com.GlobalPreferences.plist

  • Does not retain system sound preference settings

    I use a Tascam US 1800 audio I/O with my Mac Pro, but I have to reset the System Preferences to the US 1800 every time I restart the computer. The computer defaults to Line In and Line Out.
    I thought perhaps there was something wrong with the US 1800, so I tested it with my MacBook Pro and that computer retains the Sound preferences to the US 1800 when shut down and restarted. So it seems like the issue is with the Mac Pro.
    Does anyone have an idea what may be causing this and how to remedy it?
    Thanks!
    dm

    The permissions are totally wrong. It looks like someone has intentionally changed them.
    First, since I don't know what other damage has been done, you should at the very least back up all data and then run Repair Permissions in Disk Utility. That action may fix some (not all) other files with wrong permissions, but it wont fix this one.
    If you have more than one user account, you must be logged in as an administrator to carry out these instructions.
    Triple-click anywhere in the line below to select it:
    sudo chown 202:202 /L*/P*/A*/*.audio.*.plist; sudo chmod -N $_
    Copy the selected text to the Clipboard (command-C).
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. If you don’t have a login password, you’ll need to set one before you can run the command. You may get a one-time warning not to screw up. Confirm. You don't need to post the warning. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    Quit Terminal and reboot.

  • Sound Preferences

    I am planning to save my cassettes to iTunes with Audacity but the user guide suggests I need to make changes to my Sound Preferences.  However, the recommended options do not appear for me.  eg For Input I only get Audio Line-In but nothing about USB etc.  How do I get the all the options that appear should be available to me so that I can make the required changes?

    Usually other audio sources only show up in the Sound preferences when they are attached and the Mac has detected them.Have you connected them to your mini?
    Sometimes devices must also be created in Audio MIDI Setup which is in the Apps/Utilities folder before they are usable.

  • Why cant I change sounds for alerts in Mavricks

    Hi there,
    I tried changing sound affects in System Preferences/Sounds/Sounds Effects, and then selecting the one I want, but it's not playing at all now. Before that I had another sound for the alert. I'd like to change it for when I hear the notifications comming from my iCal I don't enjoy that sound that is there by default.
    Let me know if one of you guys were able to change the alert sound in the new OSX Mavericks
    Thanks in adavnce
    Chris

    Doug,
    I think you need to first remove the fast motion effect before you can apply the slow motion.
    Select the clip and hit the delete key once. That should get the clip back to its original state and you'll be able to slow it down.
    Matt

Maybe you are looking for

  • IC WebClient 5.0 Configuration Guide....

    Hi, Could someone please mail me the configuration guide for for IC WebClient (CRM Version 5.0) to my mail id [email protected]? Thanks in advance... Regards, Phani.

  • G4Ti4200 Capture drivers

    Ok, now that I'm on the right board, I'll try this question again.      I keep running into a problem with the video capture drivers for this card.  I had no problems at all on my P4B533-E.   But on this A7V333, it keeps giving me hell. I've tried th

  • I can't get icloud to sync ALL of my information, only my calendar!?

    I have opened an account and am successfully using the iCloud calendar which automatically updates between my Mac and iPhone 4, as expected. However, it took a while for this to work and I still can't get any of the other applications, like Reminders

  • Outlook 2010 Spell Checker AutoCorrect Issue

    I have a senior executive who is running Office Professional 2010 Plus (32-bit) on Windows 7 Enterprise.  His Outlook spell checker has been working fine up to very recently (not sure of the exact date of his issue). AutoCorrect is turned on in Outlo

  • Télechargement musique rejetés par iTune store erreur 3259

    Bonjour, problème du jour :bonne connection avec iTunes store pour le choix des téléchargements , bonne connection pour le paiement, par contre toujours erreur 3259(la connection réseau a expiré) qui revient dès que je veux effectuer un téléchargemen