小智 30
以下是在 Automator 中将脚本保存为服务并在 System Preferences 中为其分配热键的说明。
这是使用显示通知(从 tkneis 的答案扩展)静音/取消静音的脚本。
on run {input, parameters}
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
set inputVolume to 100
set displayNotification to "Microphone Unmuted"
else
set inputVolume to 0
set displayNotification to "Microphone Muted"
end if
set volume input volume inputVolume
display notification displayNotification
delay 1
return input
end run
Run Code Online (Sandbox Code Playgroud)
小智 29
这最有效,特别是如果您想将此脚本分配给热键:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
set inputVolume to 100
else
set inputVolume to 0
end if
set volume input volume inputVolume
Run Code Online (Sandbox Code Playgroud)
此方法不需要您激活系统首选项 GUI,或浏览任何处于活动状态的应用程序的音量设置。相反,它获取系统的音量设置,然后检查输入音量是否已经为 0——如果是,则将输入音量设置为 100,如果不是,则将输入音量静音。
奇迹般有效。
gho*_*ppe 25
这也可以通过一个简单的 AppleScript 来完成:
tell application "System Events" to set volume input volume 0
Run Code Online (Sandbox Code Playgroud)
反转过程:
tell application "System Events" to set volume input volume 100
Run Code Online (Sandbox Code Playgroud)
编辑
顺便说一下,Soundsource是一个免费的应用程序,它为您提供了非常简单的滑块,可以从菜单栏中切换扬声器/麦克风级别,而无需烦人的额外对话框。
Stu*_*der 23
您可以简单地Alt- 单击菜单栏中的声音/扬声器图标,然后选择Line In作为输入设备以使麦克风静音。
当你想要它回来时,只需Internal microphone再次选择。

| 归档时间: |
|
| 查看次数: |
135721 次 |
| 最近记录: |