Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System "dismiss-notifications" script command doesn't work on MacOS Sequoia version 15.1 #967

Open
kg345 opened this issue Nov 15, 2024 · 6 comments

Comments

@kg345
Copy link

kg345 commented Nov 15, 2024

Running the script here results in a

Reason: /Users/myusername/Documents/raycast-scripts/test.applescript:753:759: execution error: System Events got an error: Can’t get scroll area 1 of group 1 of window "Notification Center" of process "NotificationCenter". Invalid index. (-1719)
Domain: scripts
Time: 16:41:27.117

Same error regardless if I group or do not group my notifications.

If I edit the script to see what actions/groups exists - I see there's:

  • 1 group for window "notification center"
  • 1 UI element for the group in the window
    • no actions available in the ui element
@unnamedd
Copy link
Collaborator

I don't think this is a problem on macOS Sequoia, since the way NotificationCenter/NotificationCentre/Notification Center may differ from one version of English to another. If I am not mistaken, in British English, it will be NotificationCentre.

Perhaps you can check one of those options and change it for yourself. Also, you can search through the issues because we have already discussed that in the past in the issues/PRs.

@kg345
Copy link
Author

kg345 commented Nov 18, 2024

Thanks. I do see these PRs discussing some issues (localization you mentioned, other mentioning that the center needs to be open to work).

#917
#919

I think the issue, for me, isn't related to localization - as it is finding the NotificationCenter process/window - there's just nothing to do, in terms of actions, within it so not sure there's actually a way to get this to work. I suspect the issue is likely that the "clear" or "clear all" notifications button only appears when you hover on it with your mouse and there might not be an entry point to that action with applescript.

Considering the above, I was curious if this script then worked for anyone at any point (and whether that was a prior version of macOS).

@unnamedd
Copy link
Collaborator

Very good point.
It will be quite complicated to know if it worked for anyone other than the author himself.

However, I don't really think there will be a final solution that works for everyone. I do think that for those whose computers the script doesn't work on, the best solution would probably be to make some changes to make it work for themselves. Perhaps this is going to be your situation, Kris.

@kg345
Copy link
Author

kg345 commented Nov 18, 2024

Does sound like it probably should be named with template to indicate it probably wont' work out of the box for everyone.

For anyone else stumbling on this - this gist discussion does have some working scripts (in particular, this one works for me if the notification pops out the notification center - though it loops through each item so can be a bit slow).

@unnamedd
Copy link
Collaborator

@kg345,

Even though I understand your point about using the .template, it doesn't really fit with the idea of it.
Templates are used when the user needs to make changes to the Script Command right before its use.
As this is something that would work for a large number of people using English as their main system language, it won't require any extra changes. For others, it would be interesting to add some instructions in the Script Command itself (perhaps a troubleshooting comment) mentioning that if it doesn't work, the user would need to make certain changes.

@third774
Copy link

Just chiming in to say that this script did work for me until I upgraded to Sequoia.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants