The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   System (http://hintsforums.macworld.com/forumdisplay.php?f=4)
-   -   Setting master volume with applescript (http://hintsforums.macworld.com/showthread.php?t=30666)

gcianci 11-14-2004 11:00 PM

Setting master volume with applescript
 
hi everyone,

I was wondering if you could help. I would like to write an applescript (for osx 10.3 in case it matters) to increase/decrease the master volume level (the one set by f4 abd f5) by one "unit" at a time

I know I can use a simple

set volume #a number#

but I want to increase/decrease the level with respect to its current value... I tried a few basic things but can't get it to work.

any ideas? many thanks,

G

robJ 11-15-2004 07:24 PM

Is this what you need?

Code:

-- increase by 1
set output_vol to output volume of (get volume settings)
set volume output volume (output_vol + 1)

-- decrease by 1
set output_vol to output volume of (get volume settings)
set volume output volume (output_vol - 1)

-- Rob

gcianci 11-15-2004 09:21 PM

Exactly! Thanks a lot!
 
I have to admit that the syntax is a little confusing to me though...
Especially the "volume output volume" part and the fact that there is no "to" after the second "set"... any comments?

Many thanks again! :)

robJ 11-16-2004 05:41 AM

Yep, the lack of 'to' is somewhat out of the ordinary. One possible explanation is that there was a conflict with the terminology in a scripting addition with a similar command so someone at Apple was forced to Think Different. ;)

-- Rob


All times are GMT -5. The time now is 05:58 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.