Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to Use Automator to change a system preference

I have a bluetooth device that streams sound from various sources to my hearing aids. Every time my iMac (Mavericks), boots-up, the device pairs with "Sound" preferences "Input" and establishes itself as the default input. I have found that this occurs whether or not the device is turned on. I never intend for the device to pair with my desktop. Therefore, my current solution is to open System Preferences, then select "Sound," then "Input," then "internal Microphone."


I would like to use Automator to set the sound preference when the system boots - or, next best, when Safari opens - or at least a one-click process in the dock. TIA

iMac (27-inch, Late 2012), OS X Mavericks (10.9)

Posted on Dec 8, 2013 2:09 PM

Reply
Question marked as Best reply

Posted on Dec 8, 2013 4:39 PM

Here is an AppleScript that will do this:


tell application "System Preferences" to activate

tell application "System Preferences"

reveal anchor "input" of pane id "com.apple.preference.sound"

end tell

tell application "System Events" to tell process "System Preferences"

tell table 1 of scroll area 1 of tab group 1 of window 1

select (row 1 where value of text field 1 is "Internal microphone")

end tell

end tell

quit application "System Preferences"


You can put this into an AppleScript in AppleScript Editor (it's in Utilities), or run it in Automator.

The simplest way would be to save it as an AppleScript application and use that as a login item.

I wrote it up as a standalone AppleScript application called "InputMic" and saved it to my dropbox. You can download it here if you like: https://www.dropbox.com/sh/assrkjdvns0lj9m/RjP7Mc2HcM

You can put it in your Applications folder and set it as a Login Item in system preferences > Users & Groups.

Or drag it to the dock and then run it manually, or both. It will ask for your permission to run as an accessability item in Security & Privacy settings; just click the lock in the left corner, check the box next to InputMic, and then close the lock.

2 replies
Question marked as Best reply

Dec 8, 2013 4:39 PM in response to Argyles

Here is an AppleScript that will do this:


tell application "System Preferences" to activate

tell application "System Preferences"

reveal anchor "input" of pane id "com.apple.preference.sound"

end tell

tell application "System Events" to tell process "System Preferences"

tell table 1 of scroll area 1 of tab group 1 of window 1

select (row 1 where value of text field 1 is "Internal microphone")

end tell

end tell

quit application "System Preferences"


You can put this into an AppleScript in AppleScript Editor (it's in Utilities), or run it in Automator.

The simplest way would be to save it as an AppleScript application and use that as a login item.

I wrote it up as a standalone AppleScript application called "InputMic" and saved it to my dropbox. You can download it here if you like: https://www.dropbox.com/sh/assrkjdvns0lj9m/RjP7Mc2HcM

You can put it in your Applications folder and set it as a Login Item in system preferences > Users & Groups.

Or drag it to the dock and then run it manually, or both. It will ask for your permission to run as an accessability item in Security & Privacy settings; just click the lock in the left corner, check the box next to InputMic, and then close the lock.

How to Use Automator to change a system preference

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.