# Solved: Mac OS X 10.6 Volume Level and Balance



## andynic (May 25, 2007)

Hi,

I can change the volume level from the command line using this command, for example:
osascript -e 'set Volume 3'

Is there a way to detect the current volume level using a similar command and a way to assign it to a variable?

And just for good measure, are there similar commands for detecting and setting the current balance?

Thanks for your help,
Andynic


----------



## andynic (May 25, 2007)

I found the solution.
I used the following system call to an osasciprt command from a perl script:
$currentVolumeLevel = `osascript -e 'set curVolume to output volume of (get volume settings)'`

The idea goes to Matt at http://www.macosxtips.co.uk/geeklets/system/current-volume-level-1/

Andynic


----------



## andynic (May 25, 2007)

Re. balance problem (also solved): See discussions.apple.com/message/18330761?ac_cid=142432#18330761


----------

