Skip to content

Instantly share code, notes, and snippets.

@jpignata
Created April 9, 2020 16:54
Show Gist options
  • Save jpignata/7c07d5c386ef61caf44cbc5d6ad7f970 to your computer and use it in GitHub Desktop.
Save jpignata/7c07d5c386ef61caf44cbc5d6ad7f970 to your computer and use it in GitHub Desktop.
set currentSettings to get volume settings
if input volume of currentSettings > 0 then
set volume input volume 0
else
set volume input volume 100
end if
tell application "System Events"
tell process "NotificationCenter"
set windowCount to count windows
repeat with i from windowCount to 1 by -1
click button "Close" of window i
end repeat
end tell
end tell
input volume of (get volume settings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment