set micVolume to toggleMic()
display notification micVolume with title "Mic"
return micVolume
on toggleMic()
set inputVolume to input volume of (get volume settings)
if inputVolume ≤ 5 then
set inputVolume to 100
set micVal to "🔈 unmuted"
else
set inputVolume to 0
set micVal to "🔇 muted"
end if
set volume input volume inputVolume
return micVal
end toggleMic
Automator > Quick Action から作成して、システム設定 > キーボード > ショートカット > サービス でキーボードショートカットを設定すれば一発で切り替えられるようになる