Is it possible to turn on/off "Do no disturb" for mac os x programmatically, which means by code. I've done some research by google, such as:

1. By Automator script [applescripting notification center scheduling do not disturb](http://www.tuaw.com/2013/02/04/applescripting-notification-center-scheduling-do-not-disturb/). 
By the way I don't make it work, when I killall NotificationCenter, the Do not disturb switch is still off
2. Writing defaults by code, [programmatic equivalent of defaults write command e.g. how to use NSUserDefaults](https://stackoverflow.com/questions/3693233/programmatic-equivalent-of-defaults-write-command-e-g-how-to-use-nsuserdefa), however how to work with the args -currentHost (mentioned in the article in link above)