Saturday, February 25, 2017

#1 2008-05-17 06:01:20 am

ged3000
Member
Registered: 2008-05-17
Posts: 2

Setting Sound Balance with AppleScript

Hi,

One of the speakers that I use with my computer is a bit temperamental, so I want to make an applescript to quickly adjust my balance from middle, to left, to right, and back to middle automatically, to see if it's packed in again. However, i can't seem to find any way of doing it easily, and wondered if anyone could help!

It seems that there's no easy setting to change to alter the balance (that I could find) - the only solutions I could see seem to use the Applescript UI scripting, which I can't seem to work out how to use.

Can anyone help me?

Model: Powerbook G4
AppleScript: 1.10.7
Browser: Safari 525.13
Operating System: Mac OS X (10.4)


Filed under: applescript, sound, balance

Offline

 

#2 2008-05-17 06:12:41 am

StefanK
Member
From: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11417
Website

Re: Setting Sound Balance with AppleScript

Hi,

something like this

Applescript:


tell application "System Preferences"
   activate
   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 1.0
       delay 1
       set value to -1.0
       delay 1
       set value to 0
   end tell
end tell


regards

Stefan

Filed under: System

Offline

 

#3 2008-05-17 06:52:38 am

ged3000
Member
Registered: 2008-05-17
Posts: 2

Re: Setting Sound Balance with AppleScript

That's brilliant, thankyou! Just what I was looking for!

And I was so close, it was just the "set value to..." command that I couldn't figure out for myself...

Thanks!

Offline

 

#4 2011-12-24 01:21:41 am

olli
Member
Registered: 2008-11-01
Posts: 16

Re: Setting Sound Balance with AppleScript

I have tried the above mentioned script and in Lion at least the slider's range is different.
It is not from -1 to 1 but from 0 to 1, with

0 = only left output
0.5 = centered output
1 = only right output

Hope this helps.


Filed under: preferences, sound, lion

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.037 seconds, 8 queries executed ]

RSS (new topics) RSS (active topics)