iOS 6 feature Do Not Disturb (Do Not Disturb) is difficult to overestimate - handy when the device switches itself off all the system notices when you, for example, sleep or work hard. Alas, the same opportunities devoid of OS X, which provides only a manual shutdown Notification Center. However, using the "Avtomatora" this lack of Apple desktop OSes can be easily remedied.
You will need to create a "Avtomatore" two processes: to disable and re-enable Notification Center. Both processes should be of type Calendar Reminder (Calendar Alarm) - do not forget to select the appropriate icon in the document type selection screen.
In the first process, add effects Run AppleScript (Run AppleScript) and insert the following code:
do shell script "defaults write ~ / Library / Preferences / ByHost / com.apple.notificationcenterui. *. plist doNotDisturb -boolean true" set theDate to quoted form of (do shell script "date +"% Y-% m-% d% I:% M:% S +0000 "") do shell script "defaults write ~ / Library / Preferences / ByHost / com.apple.notificationcenterui. *. plist doNotDisturbDate -date" & theDate. do shell script "killall NotificationCenter"
This script modifies the configuration file Notification Center: Enables "Do Not Disturb", assigns a specific the date and time to which the notification should not be displayed on the screen and restart the Control Center for the changes to take force.
Now save this process, for example, under the name Do Not Disturb (Do Not Disturb). As soon as you press the button OKAutomatically starts the program "Calendar", in which there will be harvesting a new event. Double-click it to open the form view the properties of the event. press Edit (Edit) and follow these steps:
- In the field with (from) and up (to) Enter the time when you want to disable Notification Center. For example, let it be 9:00.
- In the drop-down list repeat (repeat) select Configure (Custom) and in the resulting window, click on all working days. press OK.
- Check that the section resemble (alert) already indicated the action Open the file (Open File), The name of the newly created file Do Not Disturb (Do Not Disturb) and the reminder time 0 min. to (0 minutes before).
- press Finish (Apply) to save the settings of the calendar event.
Switch MC ready. Now I need a switch. Create a new Calendar Reminder (Calendar Alert) and add effects Run AppleScript (Run AppleScript) with this code:
do shell script "defaults write ~ / Library / Preferences / ByHost / com.apple.notificationcenterui. *. plist doNotDisturb -boolean false" try do shell script "defaults delete ~ / Library / Preferences / ByHost / com.apple.notificationcenterui. *. plist doNotDisturbDate" end try. do shell script "killall NotificationCenter"
This script performs the inverse operations - adjusts the configuration file MC so that the function of "nebespokoystva" has been disabled.
Save the process called Enable Notification Center (Activate Notification Center)And "Calendar" make a similar setting events, determining the execution time for him 18:00 and check the name of the newly saved in the process section resemble (alert).
That's all the case. Now every business day, Monday through Friday, Notification Center will be switched off at 9 o'clock in the morning and switched back at 18:00, thus saving you from annoying messages during operation. Of course, the time frame can be set to your liking.
Housekeeping tip. Do not forget about the button Calendars (Calendars) organizer in OS X, you can use to disable the display of calendar events Automator (It is automatically created when you save the first type "calendar reminders" of the process). Since these highly official events will not clutter up your schedule.