Skip to content

Commit ad8406f

Browse files
authored
Update dismiss-notifications.applescript to work on Sequoia
1 parent 4b0811a commit ad8406f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

commands/system/dismiss-notifications.applescript

+11-13
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@
1414
# @raycast.author benyn
1515
# @raycast.authorURL github.com/benyn
1616

17-
tell application "System Events"
18-
tell process "NotificationCenter"
19-
if not (window "Notification Center" exists) then return
20-
set alertGroups to groups of first UI element of first scroll area of first group of window "Notification Center"
21-
repeat with aGroup in alertGroups
22-
try
23-
perform (first action of aGroup whose name contains "Close" or name contains "Clear")
24-
on error errMsg
25-
log errMsg
26-
end try
17+
tell application "System Events" to tell application process "NotificationCenter"
18+
try
19+
repeat with uiElement in (actions of UI elements of scroll area 1 of group 1 of group 1 of window "Notification Center" of application process "NotificationCenter" of application "System Events")
20+
if description of uiElement contains "Close" then
21+
perform uiElement
22+
end if
23+
if description of uiElement contains "Clear" then
24+
perform uiElement
25+
end if
2726
end repeat
28-
-- Show no message on success
29-
return ""
30-
end tell
27+
return ""
28+
end try
3129
end tell

0 commit comments

Comments
 (0)