I am trying to read status of do not disturb or dnd using applescript.
For some reason, it always return "1" no matter what if the dnd is on or off.
do shell script "defaults -currentHost read ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb"
Stack Editor: Script Editor to create and run the script OS: macOS Monterey
Solution for Monterey
It returns
1
if "Do Not Disturb" is enabled,0
otherwise.