Scripting Notification Center buttons in Big Sur

I've got a script that calls phone the number highlighted on the screen. It invokes FaceTime to place the call. FaceTime displays a dialog via the Notification Center asking if I want to call the number or cancel. My scripted clicked the "Call" button. That worked...until Big Sur.
Now I get:



The action “Run AppleScript” encountered an error: “System Events got an error: Can’t get button 1 of application process "Notification Center". Invalid index.”

when I run it.

I can't show you the pre Big Sur script because I modified it for Big Sur. Yes, not having a backup was dumb.

What I'm trying now is:

Code Block
on run {input, parameters}
open location "tel://" & input & "?audio=yes"
tell application "System Events"
click button "Call" of scroll area 1 of window "Notification Center" of application process "Notification Center"
end tell
end run

This is just one of the things I tried.

Under Big Sur, accessibility Inspector shows that button hierarchy and if I hit "press" under actions, it presses the button.

How do I access the button via AppleScript? Here's the hierarchy:

Code Block
⌄Notification Center (application) [Application]
⌄Notification Center (system dialog) [NotificationCenter.NotificationCenterWindow]
⌄<empty description> (scroll area) [SwiftUI.HostingScrollView]
⌖Call (Button) [BorderlessButtonCell]
<empty descriptipn> (image) [NSImageCell]
Rob Osattin (text) [NSTextFieldCell]
Click Call to make this call (text) [NSTextFieldCell]
Cancel (button) [BorderlessButtonCell]
<empty description> (group) [VibrantBox]
<empty description> (group) [VibrantBox]

Thanks,
Rob Osattin
Atlanta


Did you ever find a solution?

i am having the same issue - can somebody point me in a better direction thanks Darren

Scripting Notification Center buttons in Big Sur
 
 
Q