|-- Toggle Notification Center's DND on Yosemite|
|tell application "System Events"|
|option key down|
|click menu bar item "Notification Center" of menu bar 2 of application process "SystemUIServer"|
|click menu bar item "NotificationCenter, Do Not Disturb enabled" of menu bar 2 of application process "SystemUIServer"|
|option key up|
The ordering of the menu bars of SystemUIServer seems to be different on each person's computer. To avoid that, I wrote this:
Another variation to get El Capitan to work.....