Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase volume on mac using AppleScript?

I found the command, but can I do it in AppleScript?

like image 972
Matt Avatar asked Nov 18 '10 23:11

Matt


1 Answers

Yes, you can: use set volume output volume N, where N is an integer from 0 to 100. Since there are 16 squares in the volume interface, and 100/16 = 6.25, there's no direct map from squares to this number, but you'll be fine if you think about it as a percentage. There's also the ability to set the input volume with set volume input volume N, and the alert volume with set volume alert volume N; set volume output muted BOOL mutes the output if BOOL is true, and unmutes it if it's false. (Alternatively, set volume ... with output muted or set volume ... without output muted.) You can stack these if you want to set multiple things at once. As Adam Rosenfield says, there's also set volume R, which (according to my docs) takes a real number between 0 and 7; however, this is deprecated, and has a strange range; I'd just use set volume output volume instead. If you want to query the current volume, you can run get volume settings, which returns a record of the form {output volume:82, input volume:46, alert volume:100, output muted:false}.

like image 97
Antal Spector-Zabusky Avatar answered Oct 27 '22 13:10

Antal Spector-Zabusky