Re: get current system volume / Again
Re: get current system volume / Again
- Subject: Re: get current system volume / Again
- From: Andrew Oliver <email@hidden>
- Date: Fri, 04 Mar 2005 00:23:05 -0800
On 3/4/05 12:03 AM, "Christian Vinaa" <email@hidden> wrote:
> At 16:39 -0700 03/03/2005, Michelle Steiner wrote:
>> On Mar 3, 2005, at 1:12 PM, Jason Davies wrote:
>>
>>>> set x to sound volume
>>>> set sound volume to 0
>>>> delay 10
>>>> set sound volume to x
>>>
>>> did you run this ...?:-) or is Standard Additions not automatically
>>> installed? anyway, I get an error (not that I am not grateful to you and
>>> everyone else..)
>>
>> Try this instead:
>>
>> set x to output volume of (get volume settings)
>> set volume 0
>> delay 10
>> set volume x
>
>
> this script sets sound to max at end ?
No. It tries to reset the volume to whatever it was before the sound was
muted. Unfortunately it doesn't do that due to some legacy issues.
It doesn't work because on its own 'set volume' uses the old/deprecated 0-7
scale for volume settings, but 'output volume of (get volume settings)'
returns the more modern 0-100 scale.
The above code, as written, has a 93% chance of setting the volume to max
when it finishes.
If you're using 'get volume settings' and 'set volume' to temporarily change
the volume settings, the appropriate syntax would be:
set originalVolume to output volume of (get volume settings)
set volume output volume 10 -- or whatever number, just note the syntax
beep
set volume output volume originalVolume
However, to meet the original poster's requirement to temporarily mute the
sound (rather than the above code which raises/lowers as appropriate) use:
set wasMuted to output muted of (get volume settings)
set volume output muted true
-- your code here
set volume output muted to wasMuted
Andrew
:)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden