Il s'agit du script :
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
Et voici l'erreur que j'obtiens :
error "System Events got an error: Can’t get static text 1 of window 1 of process \"NotificationCenter\". Invalid index." number -1719 from static text 1 of window 1 of process "NotificationCenter"
Je travaille sous MacOS Big Sur 11.4.