Here's the AppleScript code:
set phone_num to "1111111111"-- (put your own number here)
tell me to activate
display dialog "" buttons {"FaceTime", "Call", "Cancel"} default button 2 with icon path to resource "AppIcon.icns" in bundle (path to application "FaceTime")
-- FaceTime
if result = {button returned:"Yes"} then
do shell script "open facetime://" & quoted form of phone_num
tell application "System Events"
repeat while not (button "Call" of window 1 of application process "FaceTime" exists)
delay 1
end repeat
click button "Call" of window 1 of application process "FaceTime"
end tell
-- Call
else if result = {button returned:"Call"} then
tell application "FaceTime"
activate -- bring FaceTime to front
end tell
tell application "System Events"
tell process "FaceTime"
tell toolbar of window 1
-- click "Audio" window
click (first button where its accessibility description = "Audio")
-- put phone number in textbox
keystroke phone_num
-- CLICK "Call Using iPhone" button
end tell
end tell
end tell
-- Quit
else
tell application "FaceTime" to activate
delay 1
tell application "System Events" to keystroke "q" using {command down} -- quit FaceTime
end if