Mac 勿扰模式周期性开关闭功能实现脚本
生活随笔
收集整理的這篇文章主要介紹了
Mac 勿扰模式周期性开关闭功能实现脚本
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
專心開(kāi)發(fā)工作的時(shí)候,通知滴滴答答響個(gè)不停,影響效率和心情? 。
發(fā)現(xiàn) Mac 提供了臨時(shí)屏蔽通知的功能,就是 勿擾模式。
不錯(cuò),可以安心工作了。缺點(diǎn)就是容易忘記關(guān)閉勿擾,錯(cuò)過(guò)一些重要的通知。
可是每次手動(dòng)開(kāi)啟關(guān)閉又顯得麻煩。如果我正在使用番茄鐘工作,想要25分鐘勿擾 5分鐘盡管擾呢?
AppleScript!這貨系統(tǒng)自帶的,好用,幾行腳本就輕松實(shí)現(xiàn)了。
前提:在系統(tǒng)快捷鍵中 將打開(kāi)關(guān)閉勿擾模式的快捷鍵設(shè)置為 cmd+shift+option+control+d
applescript
repeat while trueignoring application responsestell application "System Events" to keystroke "D" using {command down, shift down, option down, control down}end ignoringsay "DND opened"delay 1500ignoring application responsestell application "System Events" to keystroke "D" using {command down, shift down, option down, control down}end ignoringsay "DND closed"delay 300 end repeat總結(jié)
以上是生活随笔為你收集整理的Mac 勿扰模式周期性开关闭功能实现脚本的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Android GIS开发系列-- 入门
- 下一篇: zabbix监控多台站点服务器