Make a facetime Call

Posted on
Fri Mar 04, 2016 2:56 pm
artpics offline
Posts: 232
Joined: Feb 24, 2009
Location: Calabasas CA

Make a facetime Call

i want to use the below code which i came across, so when my DSC alarm is triggered it makes a FaceTime call to me. everything seems to work but this line does not complete any help would make me happy. :D

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

Posted on
Fri Mar 04, 2016 3:25 pm
peteinau offline
Posts: 65
Joined: Jan 10, 2015

Re: Make a facetime Call

Hi,

The return key won't actually connect the FaceTime call, you need the following code:

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

Which will click the actual call button. You will need to make sure that you have Accessibility turned on for the app you are running it from tho otherwise it will still fail.

Posted on
Fri Mar 04, 2016 6:54 pm
artpics offline
Posts: 232
Joined: Feb 24, 2009
Location: Calabasas CA

Re: Make a facetime Call

thanks it rings :shock: will do some more testing later

Posted on
Sat Mar 05, 2016 2:36 pm
artpics offline
Posts: 232
Joined: Feb 24, 2009
Location: Calabasas CA

Re: Make a facetime Call

EDIT:
for mac minis no camera you have to change the first line to this.

Code: Select all

open location "facetime-audio://" & "change to your phone number" & "?audio=yes"



:D

Posted on
Thu Jun 29, 2017 12:01 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Make a facetime Call

peteinau wrote:
Hi,

The return key won't actually connect the FaceTime call, you need the following code:

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

Which will click the actual call button. You will need to make sure that you have Accessibility turned on for the app you are running it from tho otherwise it will still fail.


I am trying to bring it inside Indigo, but I do not understand where this part of code goes into.
Into which "tell application "System Events" shall it go?

Would it be possible to have the complete code?

Thanks
Marco

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests