Dismiss Notifications With a Keyboard Shortcut Using Automator

It can be annoying to have notifications appear at the top right corner of your screen while you are typing. Normally, you have to move the cursor to click on the Close button to dismiss those. However, you can build a simple JavaScript service in Automator to do it, and then use a keyboard shortut to trigger that service.

function run(input, parameters) {
	var app = Application('System Events');
	app.includeStandardAdditions = true;
	app.processes.byName('Notification Center').windows.buttons[0].click();

	return input;
}

Comments: 2 Responses to “Dismiss Notifications With a Keyboard Shortcut Using Automator”

    Ros
    2 weeks ago

    When I open System Preferences and select Notifications, Automator does not appear in the left hand pane. So I cannot
    select “Alert” (or “Banners”, or “None”)

    Ak
    2 weeks ago

    When I try the script in Automator and in the apps all runs well but when I want to do it with the shortcut it takes me to Automator

Leave a New Comment Related to "Dismiss Notifications With a Keyboard Shortcut Using Automator"

:
:
:
0/500 (500 character limit -- please state your comment succinctly and do not try to get around this limit by posting two comments)