We’re rewarding the question askers & reputations are being recalculated! Read more.
433

With Mavericks and later, you can do this using AppleScript's 'display notification': display notification "Lorem ipsum dolor sit amet" with title "Title"                            That's it—literally that simple! No 3rd-party libraries or apps required and is completely portable for use on other systems. 10.9 notification on the top, 10.10 DP in the ...


97

terminal-notifier From the README: terminal-notifier is a command-line tool to send Mac OS X User Notifications, which are available in Mac OS X 10.8. It is currently packaged as an application bundle, because NSUserNotification does not work from a ‘Foundation tool’. radar://11956694 This tool will be used by Kicker to show the status ...


70

Unfortunately, you can't change the screen position of the Notification Center Alerts and Banners. This is a huge gripe of mine as well, and I highly encourage you to complain about this issue to Apple here: http://www.apple.com/feedback/macos.html Hopefully they will one day change this. I also have not been able to find or formulate any hacks. I, too, am ...


45

Option + Click the menu bar Actually, there is a Menu Bar icon, of sorts. To toggle Do Not Disturb you can just hold the option key down while you click on the Notification Centre icon at top right of your Menu Bar. Doing this will instantly make any visible notifications disappear and grey out the icon. You can still click on it to manually show/hide the ...


31

You can now simply go to System Preferences > App Store, and turn off "Automatically check for updates." No messing with firewalls, and just works with App Store. So just remember to check every now and then manually to find out when you have updates!


30

I just want to add a note to @grgarside's answer, because I know many people want to have a notification popup that can only be dismissed by button click. I have found the solution for you: It was actually controlled by a setting in System Preference, rather than some parameter in the script written. These two images should explain it all Thanks @...


27

I have a solution that I was able to reverse engineer. I've tested it on my machine, running Yosemite 10.10.4 (14E46). If you can find the bundle ID (in the Info.plist file for the app bundle), you can use this script to force the app to appear in the notifications preferences pane. # "Usernoted" seems to be the "user notifications daemon", so get it's PID. ...


25

You can create Automator service to run this Applescript and give it a keyboard shortcut in the System Preferences Keyboard shortcuts This will close Alert and banners Notification In Automator choose a new service Add a Run Applescript Action and replace it's code with: my closeNotif() on closeNotif() tell application "System Events" tell ...


24

Complementing Monomeeth's excellent answer, there's also a toggle button available in the Notification Center in macOS. This is sort of the shortcut (albeit a bit lengthy) you are looking for. Click on the Notification Center button in the far right on the Menu bar to reveal the Notification Center UI. Now with the Today tab selected, scroll down to reveal ...


23

You can now do this with Growl2 (available from the App Store). Install Growl and enable "OS X Notifications" (screenshot) Additionally, you'll need to install GrowlNotify for a command-line tool to send Growl notifications. You can download this tool for free on the Download page. You can now generate Growl notifications from the command line, which will ...


21

Swipe with two fingers on the banner pop up and it will remove it. Not the best answer but convenient for when I need to access a control or tab. Source: http://www.cultofmac.com/189192/


21

Open Safari › Preferences › Notifications There you can remove objects permanently by selecting the notification you wish to delete and then either hitting the delete key or by using the remove button ('-') if it exists.


21

Go System Preferences > Security & Privacy > Privacy [tab] Uncheck and recheck 'Weather' and it's back to normal See below img


18

I just discovered the missing solution here: http://osxdaily.com/2012/11/15/stop-software-update-mac-os-x/ You can selectively disable notifications about specific software updates you don't care about (like useless App updates) by control-clicking the update inside the App Store to reveal a hidden "Hide Update" option. This is best for those who want to ...


18

There is an option to "show preview" that can be ticked off in the settings of the Messages app: Go to Settings> Notification> Messaging. Stated another way: 1) Go to Settings = Click on the GEAR icon (System Preferences) 2) The top-most section of System Preferences on My Mac is labeled "Personal" at the far right is "Notifications" (a black square with ...


16

I recently forked terminal-notifier to build a command line tool to display notification Alerts (with actions) and Reply Type Alerts. I use it with my shell scripts and golang apps to get interactive answers from users. https://github.com/vjeantet/alerter


16

@grgarside's solution is nice, but it is vulnerable to script injection, which can be a major security issue when this is used to e.g. display log file contents or something similar. This should be safer: #!/bin/bash X="$*" /usr/bin/osascript -e 'display notification system attribute "X"'


16

To turn off notifications: sudo defaults write com.apple.usbd NoiPadNotifications -bool YES sudo killall usbd To turn them back on: sudo defaults delete com.apple.usbd NoiPadNotifications Via Craig Hockenberry


15

You can adjust the time the notification is displayed on the screen: In a terminal window type: defaults write com.apple.notificationcenterui bannerTime SECONDS Where SECONDS is the number of seconds the notice will remain visible. Default is 5 seconds. Log out and in again to activate the setting. http://www.defaults-write.com/notification-center-...


14

Since Growl is not free, and terminal-notifier is not available on pre-10.8 systems, I tend to use cocoaDialog. It is free and open source, so you can probably also distribute along with your scripts. If you don't need a lot of customization, you can also use AppleScript's display notification which you can also call from the shell as others have already ...


14

As well as the answers given, if your Mac has a Touch Bar, you can customise it to include a toggle for Do Not Disturb in the Control Strip which is (nearly) always visible. Of course, you'll have to give up one of the other functions from the Control Strip -- the defaults are brightness, volume, mute and Siri.


13

You might wonder why a two finger gesture on the trackpad from the right edge to the left edge doesn't always allow you to quickly access the brand new Notification Center in Mountain Lion. Apple's instructions state: Swipe to the left from the right edge of the trackpad to visit Notification Center anywhere in OS X. Even from a full-screen app. What ...


13

This is an old question, but just in case someone stumbles on it and is specifically worried about the privacy implications of Notification Center, the answer is YES, OS X does keep a log of notifications on disk. The format is an sqlite database, and it can be found inside this folder: ~/Library/Application Support/NotificationCenter Inside you'll find ...


12

(This is an alternative implementation based on @grgarside's excellent answer.) AppleScript can be interpreted directly by putting osascript in the shebang line. #!/usr/bin/osascript on run argv if length of argv = 1 then display notification (item 1 of argv) with title "Notification" else if length of argv > 1 then display ...


11

The Facebook integration wasn't available when this question was asked - it was added in OS X 10.8.2 in September 2012. To activate Twitter and Facebook sharing, you must first configure at least one Twitter and / or Facebook account via System Preferences -> Mail, Contacts & Calendars -> Add Account -> Twitter (or Facebook). Once you've ...


11

There is an "include" and a "do not include" section in Notification Center. Tap "edit" at top right corner of the Notification Center. This allows you to drag apps around in the Notification Center. Hold the app you want to stop push notifications from, by the lines on the right hand side to its name, and drag it into "do not include" section. It will ...


10

To return to the top of a long web page, just tap the Status Bar (at the top that also display the current time and battery status) instead of swiping. It works in many other apps too.


10

I can only say that this is true. Mail.app has to be open to get notifications. A workaround: Open Mail, and close it with the red dot (or command+w). So the blue point under the icon in the Dock is still there. So you have no window open but mail is still getting emails. There is no app or anything there yet to fix this "problem".


10

The best solution I've found for this so far has been to ⌥+'click' the notifications menu icon in the top right and disable notifications. This resets every day though.


10

I found that the preferences for the notification center are located in a sqlite database in ~/Library/Application Support/NotificationCenter/ The file is named with a GUID so I'm not sure if it's the same for every account, but it was the only file in the directory and has a .db extension. I used the following sql command update app_info set flags = 134 ...


Only top voted, non community-wiki answers of a minimum length are eligible