So, after a bit of head bashing since trying to help @Tree_Frog, I have since made some new discoveries.
@Silverstone, I initially had a somewhat similar issue. I maintained an Alfred workflow that allowed people to make calls and send iMessages via Alfred. There was an option to skip the confirmation of the call (would click call button for you), which seems to have changed EVERY OS X/macOS release that I can remember. Sequoia has been the most unforgiving of all the OSs in this regard.
Anyway, I eventually managed to find a way to automate that damn button! (I know you arenât asking about the button, but bear with me)
Every tool I tried to use was a lie. Accessibility Inspector, UI Browser 3, UIElementInspector, whatever tool comes with BetterTouchTool, etc⌠I basically just had to recursively loop through everything until I eventually found what I need.
Before I get to the scripts, here is something I noticed:
-
Everything basically needs Accessibility permissions. I gave said permissions to Terminal.app, Script Editor.app, Xcode.app, etc⌠I have even gone as far as exporting scripts as âApplicationsâ in Script Editor and giving them accessibility permissions too (if necessary). Swift binaries? Accessibility Permissions too.
-
If you do not do #1, then you will get that application process FaceTimeNotificationExtension of application "System Events"
-
I canât exactly test calling myself with FaceTime audio because the UI changes to me being the caller and not the recipient. (I assume you are talking about the call recipient, right?)
The script to click on the call button:
# iPhone Call
#do shell script "open 'tel://0123456789'"
# FaceTime Audio Call
do shell script "open 'facetime-audio://0123456789'"
tell application "System Events"
# Gives about 3 seconds max for the notification/button to appear
# Takes my old Mac around 2.75 seconds
set countdown to 15 -- Set the number of seconds for the countdown
repeat while countdown > 0
try
click button 1 of group 4 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 of scroll area 1 of group 1 of group 1 of window "Notification Center" of application process "NotificationCenter"
exit repeat
on error errorMessage number errorNumber
return errorMessage
end try
delay 0.25
set countdown to countdown - 1
end repeat
end tell
From the notification (that I create to call someone) here is how you get their name, the call recipient (or their phone number if not a contact):
tell application "System Events"
try
set callerName to description of static text 1 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 of group 1 of scroll area 1 of group 1 of group 1 of window "Notification Center" of application process "NotificationCenter"
return callerName
on error errorMessage number errorNumber
return "Error: " & errorMessage
end try
end tell
I would imagine getting the incoming callerâs name would be quite similar. If you know of a way to test this, then I can maybe try and see what I can do to help if time permits.