FaceTime Script

I have scripted a FaceTime call, but have been unable to complete the goal of calling, without clicking FaceTime’s dialog button. I would like the script to complete the action, by itself.
I welcome any suggestions.


set phone to "800-275-2273" -- Apple Support
open location "facetime://" & phone & "?audio=yes"

set phone to "800-275-2273" -- Apple Support
open location "facetime://" & phone & "?audio=yes"

tell application "System Events" to tell application process "FaceTime"
	repeat until window "FaceTime" exists
		delay 0.1
	end repeat
	tell window "FaceTime" to tell button "Call" to perform action "AXPress"
end tell
tell application "FaceTime" to activate

It would be more logical to code :

set phone to "800-275-2273" -- Apple Support
open location "facetime://" & phone & "?audio=yes"

tell application "FaceTime" to activate
tell application "System Events" to tell application process "FaceTime"
	set frontmost to true # useful with 'old' operating systems
	repeat until window "FaceTime" exists
		delay 0.1
	end repeat
	tell window "FaceTime" to tell button "Call" to perform action "AXPress"
end tell

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mercredi 31 juillet 2019 11:50:41

I don’t know, but doesn’t my script work with old systems? And how old? There is no need to activate FaceTime for the first time, since opening this URL will activate it automatically. And there is a need to activate at the end, as the FaceTime window goes into the background (behind the Script Editor window). This is exactly what happens to your script.