From bc8aff3e5fcf08046ef21f8b061118d903baf35d Mon Sep 17 00:00:00 2001 From: annietma Date: Fri, 26 Jan 2024 14:05:08 -0800 Subject: [PATCH] toggle mute --- ...oggle-mute-notification-sounds.applescript | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 commands/system/audio/toggle-mute-notification-sounds.applescript diff --git a/commands/system/audio/toggle-mute-notification-sounds.applescript b/commands/system/audio/toggle-mute-notification-sounds.applescript new file mode 100644 index 000000000..779a3f4a8 --- /dev/null +++ b/commands/system/audio/toggle-mute-notification-sounds.applescript @@ -0,0 +1,27 @@ +#!/usr/bin/osascript + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Toggle Mute Notifcation Sounds +# @raycast.mode silent +# @raycast.packageName System + +# Optional parameters: +# @raycast.icon 🔔 + +# Documentation: +# @raycast.author Annie Ma +# @raycast.authorURL http://www.anniema.co/ +# @raycast.description Toggles notification sounds. + +set volumeSettings to get volume settings +set alertVolume to alert volume of volumeSettings + +if alertVolume > 0 then + set volume alert volume 0 + display notification "" with title "Muted notification sounds" +else + set volume alert volume 100 + display notification "" with title "Unmuted notification sounds" +end if +