• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Speakable Item and SpeechRecognitionServer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speakable Item and SpeechRecognitionServer


  • Subject: Re: Speakable Item and SpeechRecognitionServer
  • From: DigitEL <email@hidden>
  • Date: Sat, 19 Sep 2009 14:21:35 -0700

Bruce >

I ran yer code in ScriptEditor under 10.4.11 and it worked all the way through until 'AppleEvent Timed Out'.
--
ForNow
DigitEL



On Sep 19, 2009, at 11:22 AM, Bruce Robertson wrote:

property commandList : {{commands:{"good morning"}, code:"turn on \"Coffee
Maker\""}, ¬
{commands:{"going outside"}, code:"turn off \"Living Room Lamp \""}}


set speechCommands to {}
repeat with thisCommand in commandList
    set speechCommands to speechCommands & commands of thisCommand
end repeat

beep
set timePeriod to 10
say "beep"

-- Try to get SpeechRecognitionServer to be recognised as an application
application ((path to library folder from system domain as Unicode text) ¬
&
"Frameworks:Carbon.framework:Versions:A:Frameworks:SpeechRecognition.f ramewo
rk:Versions:A:Resources:SpeechRecognitionServer.app")


say "Listening now"

--repeat
tell application "SpeechRecognitionServer"
try
say "Listening then"
set chosenCommand to listen for speechCommands with prompt "Choose
an option [[emph +]]" giving up after timePeriod
if chosenCommand is "quit" then
quit
else
repeat with thisCommand in commandList
if chosenCommand is in commands of thisCommand then


                    using terms from application "Finder"
                        tell application "Finder"
                            say thisCommand
                        end tell
                    end using terms from

                    exit repeat
                end if
            end repeat
        end if
    on error errmsg
        beep
        tell application "Finder" to display dialog errmsg
    end try
end tell
-- end repeat

_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Speakable Item and SpeechRecognitionServer (From: Bruce Robertson <email@hidden>)

  • Prev by Date: Re: Speakable Item and SpeechRecognitionServer
  • Next by Date: Re: Speakable Item and SpeechRecognitionServer
  • Previous by thread: Re: Speakable Item and SpeechRecognitionServer
  • Next by thread: Password
  • Index(es):
    • Date
    • Thread