0

When I used macOS Mojave I always used this AppleScript automatized with Keyboard Maestro, to auto close the boring system message Disk Not Ejected Properly. It always worked fine with Mojave. Now with Big Sur it doesn't do anything. What's the problem? Maybe it may be necessary to change something in the script? I solved it in another way for now, but that solution was more clean and elegant.

    tell application "System Events"
tell process "NotificationCenter"
    set numwins to (count windows)
    repeat with i from numwins to 1 by -1
        tell window i
            set temp to value of static text 1
        end tell
        if temp contains "Disk Not Ejected Properly" then
            click button "Close" of window i
        end if
    end repeat
end tell
end tell
6
  • Or just eject the disk properly? Mar 5 at 22:17
  • There's no need.
    – Alticoo
    Mar 6 at 7:52
  • Hardly a 'boring' message. Ignore it at your peril and one day you'll find you have a corrupted disk. Learn to eject properly, this isn't Windows. Mar 6 at 21:51
  • @Alticoo According to whom? Windows people? Windows zorches USB drive too. Mar 6 at 22:41
  • USB drive......
    – Alticoo
    Mar 7 at 10:04

0

You must log in to answer this question.

Browse other questions tagged .