Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. repeat
  2.     -- Check to see if Facetime is active
  3.     tell application "System Events" to set theCount to the count of (processes whose name is "Facetime")
  4.     if theCount = 0 then
  5.         do shell script "sleep 1"
  6.     else
  7.         tell application "FaceTime" to activate
  8.         do shell script "sleep 2"
  9.         tell application "FaceTime" to activate
  10.         tell application "System Events" to tell process "FaceTime"
  11.             if name of front window contains "with" then
  12.                 do shell script "sleep 5"
  13.             else
  14.                 tell application "System Events" to activate application "FaceTime"
  15.                 keystroke return
  16.                 do shell script "sleep 5"
  17.                 -- Check to see if call is active
  18.                 tell application "System Events" to tell process "FaceTime"
  19.                     if name of front window contains "with" then
  20.                         do shell script "sleep 5"
  21.                     else
  22.                         -- Quit Facetime if call is not active
  23.                         tell application "FaceTime" to quit
  24.                         do shell script "sleep 5"
  25.                     end if
  26.                 end tell
  27.             end if
  28.         end tell
  29.     end if
  30. end repeat
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement