How do I dismiss many multiples of the “Disk Not Ejected Properly” notification in macOS?

apple.stackexchange https://apple.stackexchange.com/questions/350335

質問

Today I'm dealing with the following problem:

Never Ending Eject Notifications

Is there some way I can get rid of these without spending my entire day clicking, short of Homer's Drinking Bird?

Note: This is not a duplicate of How do I clear All OS X notifications with 1 click?, because the notifications in my question aren't shown at all in the Notification Center, and thus the solution in that question doesn't work for this question.

役に立ちましたか?

解決

I started killing processes with "Notification" in their name, and when I hit the one called "NotificationCenter" the smoke finally cleared:

killall NotificationCenter

他のヒント

The Apple Script from "software is fun", with 3 votes at the time of writing, in the suggested duplicate gets rid of all "Disk Not Ejected Properly" notifications on High Sierra (additionally you have to allow Script Editor to control the computer in Accessibility preferences as the post suggests):

tell application "System Events"
    tell process "NotificationCenter"
        set numwins to (count windows)
        repeat with i from numwins to 1 by -1
            click button "Close" of window i
        end repeat
    end tell
end tell
ライセンス: CC-BY-SA帰属
所属していません apple.stackexchange
scroll top