Июл 05, 2016
FaceTime в пустоту
Так, это надо не потерять. Давно хотел запилить автоответчик для FaceTime на Маке... Хардкорный AppleScript для старта, как раз на поиграться:)
Логика примерно такая: поступает входящий, ждём 10сек., берём трубку, мьютим микрофон, через 10сек. ложим трубку... и стараемся не крешится, если соединение закроется раньше времени. Остальное костыли.
repeat
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
do shell script "sleep 2"
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 5"
click button "Accept" of window 1
do shell script "sleep 2"
try
click checkbox "Mute" of window 1
end try
do shell script "sleep 10"
try
click button "End" of window 1
end try
else
tell application "System Events" to activate application "FaceTime"
keystroke return
do shell script "sleep 5"
tell application "System Events" to tell process "FaceTime"
if name of front window contains "with" then
do shell script "sleep 5"
else
tell application "FaceTime" to quit
do shell script "sleep 5"
end if
end tell
end if
end tell
end if
end repeat