使用 AppleScript 在 mac 上增加音量? [英] Increase volume on mac using AppleScript?

查看:31
本文介绍了使用 AppleScript 在 mac 上增加音量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了命令,但我可以在 AppleScript 中执行吗?

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

推荐答案

是的,你可以:使用set volume output volume N,其中N 是一个从 0100 的整数.由于音量界面中有 16 个方格,并且 100/16 = 6.25,因此没有从方格到这个数字的直接映射,但是如果您将其视为百分比就可以了.还可以使用set volume input volume N 设置输入音量,以及使用set volume alert volume N 设置警报音量;set volume output muted BOOL 如果 BOOLtrue,则静音输出,并取消静音如果它是 false.(或者,set volume ... with output mutedset volume ... without output muted.)如果你想一次设置多个东西,你可以堆叠这些.正如 Adam Rosenfield 所说,还有 设置音量R,它(根据我的文档)取 0 到 7 之间的实数;然而,这是不推荐使用,并且有一个奇怪的范围;我只是使用 set volume output volume 代替.如果要查询当前音量,可以运行get volume settings,它会返回一个格式为{output volume:82, input volume:46, alert volume:100, output静音:假}.

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}.

这篇关于使用 AppleScript 在 mac 上增加音量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆