Remote Speech

Discussion in 'Mac Programming' started by simplebeep, Sep 28, 2008.

  1. macrumors member

    simplebeep

    Joined:
    Sep 28, 2007
    Location:
    SLC
    #1
    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):

    Code:
    using terms from application "Finder"
        tell application "Finder" of machine theAddress			
            try
                say mrSay using mrVoice
            on error
                say mrSay
            end try  [I]--Since mrVoice is user-defined, this is a simple failsafe.[/I]
        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.
     
  2. macrumors 6502a

    Joined:
    Jan 15, 2007
    #2
    Just for debugging purposes

    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.
     
  3. thread starter macrumors member

    simplebeep

    Joined:
    Sep 28, 2007
    Location:
    SLC
    #3
    It worked… sort of.

    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, 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?
     

Share This Page