This posting is older than 6 months and can contain outdated information.
I reply to myself...
Well, I've changed a little bit my strategy. Since I want to set the audio balance always the same way (when I need to change it), I've created 2 actions written in actionScript that I added to my menu :
- "set balance", that open the audio pref. panel (without activating/showing the window), set the balance to 0.2 and close the pref panel.
Here is the code :
---
tell application "System Preferences"
reveal anchor "output" of pane id "com.apple.preference.sound"
end tell
tell application "System Events"
tell slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences"
set value to 0.2
end tell
end tell
tell application "System Preferences"
quit
end tell
---
- "reset balance" that open the audio pref. panel (without activating/showing the window), set the balance to 0 and close the pref panel.
Here is the code :
---
tell application "System Preferences"
reveal anchor "output" of pane id "com.apple.preference.sound"
end tell
tell application "System Events"
tell slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences"
set value to 0.2
end tell
end tell
tell application "System Preferences"
quit
end tell
---
By the way, tell me if you've got a solution for my first request, it could be useful.