thanks
just paste the code below into your script editor
-- simulate pressing the Enter key
tell application "System Events"
keystroke return
- Code: Select all
open location "facetime://12345678"
delay 5
-- simulate pressing the Enter key
tell application "System Events"
keystroke return
-- Check to see if Facetime is active
tell application "System Events" to set theCount to the count of (processes whose name is "Facetime")
if theCount = 0 then
do shell script "sleep 1"
else
tell application "FaceTime" to activate
-- sets how long facetime will ring your phone (40 secs)
do shell script "sleep 40"
tell application "FaceTime" to activate
tell application "System Events" to tell process "FaceTime"
if name of front window contains "with" then
do shell script "sleep 1"
-- if call is active wait 60 seconds before rechecking
else
-- Check to see if call is still active
tell application "System Events" to tell process "FaceTime"
if name of front window contains "with" then
do shell script "sleep 1"
else
-- Quit Facetime if call is not active
if name of front window contains "facetime" then
tell application "FaceTime" to quit
do shell script "sleep 1"
end if
end if
end tell
end if
end tell
end if
end tell