Skip to content

Instantly share code, notes, and snippets.

@wtser
Last active September 16, 2019 08:41
Show Gist options
  • Save wtser/5d3505c1d93d7a89f955b2ff77bd6238 to your computer and use it in GitHub Desktop.
Save wtser/5d3505c1d93d7a89f955b2ff77bd6238 to your computer and use it in GitHub Desktop.
DND auto for Mac
# 在系统快捷键中 将打开关闭DND的快捷键设置为 cmd+shift+option+control+d
repeat while true
ignoring application responses
tell application "System Events" to keystroke "D" using {command down, shift down, option down, control down}
end ignoring
say "DND opened"
delay 1500
ignoring application responses
tell application "System Events" to keystroke "D" using {command down, shift down, option down, control down}
end ignoring
say "DND closed"
delay 300
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment