"Say" stops working when run as file

Posted on
Fri Nov 06, 2015 11:11 am
DrLove offline
Posts: 260
Joined: Dec 12, 2014
Location: Sweden

"Say" stops working when run as file

Hi!

I'm working on an Applescript to use Facetime as an intercom for my front door.

I have it working in Applescript editor and as an embedded script in Indigo. But if I run it as a file (allot of waiting in the script, I don't want to hog Indigo w/ that) the speech is not working. Everything else is but all I hear is the first "say"-statement and then no more. Same if I save the script as a program and run it.

This is my code (used w/ Swedish OSx/Facetime).

Code: Select all
do shell script "open facetime://+46xxxxxxxxx"

my notify("Var vänlig vänta, uppringning sker")

set calling to false
set con to false
set no_answ to false

tell application "System Events"
   
   set i to 1
   repeat while not calling
      if button "FaceTime" of window 1 of application process "FaceTime" exists then
         click button "FaceTime" of window 1 of application process "FaceTime"
         set calling to true
         exit repeat
      end if
      set i to (i + 1)
      if i ≥ 7 then
         my notify("Tekniskt fel, knacka i stället")
         return
      end if
      delay 1
   end repeat
   
   set i to 1
   repeat while not con and not no_answ
      if name of window 1 of application process "FaceTime" contains "med" then
         set con to true
         exit repeat
      end if
      set i to (i + 1)
      if i ≥ 20 then
         set no_answ to true
         if button "Lägg på" of window 1 of application process "FaceTime" exists then click button "Lägg på" of window 1 of application process "FaceTime"
         my notify("Inget svar")
         exit repeat
      end if
      if button "Ring tillbaka" of window 1 of application process "FaceTime" exists then
         set no_answ to true
         click button "Avbryt" of window 1 of application process "FaceTime"
         my notify("Inget svar, mottagaren är upptagen")
         exit repeat
      end if
      delay 1
   end repeat
   --delay 2
   --activate application "FaceTime"
   --keystroke "r" using command down
end tell

on notify(message)
   say message without waiting until completion
end notify


EDIT: if I add an extra say in my notify function it works, strange....

Code: Select all
on notify(message)
   say message without waiting until completion
   say ""
end notify


Please help!

Best regards, L

Love Kull (yes it's my name)
Blog (in Swedish)
Sweden

Posted on
Fri Nov 06, 2015 3:41 pm
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: "Say" stops working when run as file

Just for giggles, what happens if you remove the "without waiting until completion"?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 24 guests