PDA

View Full Version : Remote Speech




simplebeep
Sep 28, 2008, 07:04 PM
Hello all. I am using AppleScript Studio to write an application that speaks text. I want to be able to get the application to speak on a remote computer, even if only on a local network, over Remote Apple Events.

I have been somewhat successful, in that, on my Leopard computer, I can speak to another Leopard computer; and I have built a preliminary "release" version, ran it on Tiger, and it could speak to my Leopard computer. But, no matter what I try, I cannot speak to a Tiger computer. :confused: All parties involved have Remote Apple Events sharing turned on.

Here's the code, in part (given the machine address, theAddress (e.g. eppc://compy.local); the text to speak, mrSay; and the voice to speak it with, mrVoice):

using terms from application "Finder"
tell application "Finder" of machine theAddress
try
say mrSay using mrVoice
on error
say mrSay
end try --Since mrVoice is user-defined, this is a simple failsafe.
end tell
end using terms from

The code works, as I have said, but when I try to speak to a Tiger computer, I get the error
Finder got an error: "Text To Speak" doesn’t understand the «event sysottos» message. (-1708)

Thanks in advance for any help/workarounds.
By the way, I want to avoid ssh solutions, and stick to the AppleScript.



foidulus
Sep 28, 2008, 07:13 PM
I would try to launch it on Tiger and have it speak to itself(ie enter the address in as 127.0.0.1) and see if that works. May help to narrow down the problem.

simplebeep
Sep 29, 2008, 05:44 PM
…have it speak to itself…

Thank you, foidulus. Your question led to the solution.

First, I ran the application on the Tiger computer, and tried to get it to remotely speak to itself; first, I entered the Bonjour name (hal.local), and the app just beachballed (http://discussions.apple.com/message.jspa?messageID=8167271), without any official error message. Then, I looked up the IP address of the computer (10.0.1.3), entered that, and then it could speak to itself no-problem.

Finally, I tried speaking to the Tiger computer from Leopard with the IP, which I had not previously done. Amazingly, it worked! :D Apparently, the actual numerical address is necessary.

But that leads me to a new (albeit less critical) question: How can I get it to work with the hal.local-type address?