Last active
February 18, 2022 00:49
-
-
Save pmbuko/499348b98b68e2d9d180e75e04648e00 to your computer and use it in GitHub Desktop.
Applescript to toggle a dark/quiet mode on your Mac.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
tell appearance preferences to set dark mode to not dark mode | |
keystroke "d" using {command down, option down, control down, shift down} | |
end tell | |
set curVolume to get volume settings | |
if output muted of curVolume is false then | |
set volume with output muted | |
else | |
set volume without output muted | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to add a keyboard shortcut for the Mission Control "Turn Do Not Disturb On/Off" item in the Keyboard pref pane for it to be able to toggle DND mode.
Save this script as an Application, then add it as an Accessibility helper app in the Security and Privacy pref pane under the Privacy tab to allow it to send keystrokes.