Stopping Quark's 'say'

Discussion in 'AppleScript' started by MorganNews, Mar 28, 2012.

  1. MorganNews

    MorganNews New Member

    Joined:
    Sep 29, 2008
    Messages:
    6
    Likes Received:
    0
    The page-layout program QuarkXpress doesn't do Services, such as speaking text, and it does its own thing with its private clipboard, so I have finally figured out an Applescript that speaks selected text in the program.

    It works just fine. I often use it for proofreading purposes, where I'll have it speak parts of articles to me, and I listen for text errors. But sometimes, the phone rings in the middle of this, or somebody comes into the office, and I want the speaking to stop.

    Command F5 (the VoiceOver toggle) doesn't work. Command-period doesn't work. Escape doesn't work. The Say boolean "stopping current speech" doesn't seem to work, or, if it does, I can't figure out how to script it properly. Basically, I just want a simple Applescript that says, "Stop talking. Do it now."

    How can I stop the talk in mid-'say'?

    Thanks.

    For others in the Quark boat who want to hear it speak, here's the script:

    Code:
    tell application "QuarkXPress"
    	set textStuff to selection as string
    	say textStuff
    end tell
    
     
    MorganNews, Mar 28, 2012
    #1
    1. Advertisements

  2. MorganNews

    Kaveman VIP Member

    Joined:
    Nov 26, 2010
    Messages:
    3,559
    Likes Received:
    48
    Location:
    Westland, NZ
    Not sure there is a simple way.
    You could break textStuff into sentences, then loop though those with a check for key press on each loop, but I'm still not sure that would work, and it would tie up the Mac in such a loop.

    The other though is to
    tell application "Finder"
    say textStuff
    end tell

    that might get escape working.
     
    Kaveman, Mar 28, 2012
    #2
    1. Advertisements

  3. MorganNews

    MorganNews New Member

    Joined:
    Sep 29, 2008
    Messages:
    6
    Likes Received:
    0
    Hey, thanks, Kaveman! Two ideas for the price of 1!

    First idea: It might be less intensive to use paragraphs. I'll explore that. I might also combine that with an instruction first to turn the sound off until the interruption loop engages, and then restore it. After all, the main concept is silence. Hmmm... programming... (mumble, mumble) ... carry the two (mumble, mumble)...

    Other bright ideas still gratefully accepted.

    The second idea was a good one, too, but had no effect. Neither escape nor Command-period worked with Finder doing the say.

    It's quite possible the relatively tiny amount of data and text sent to the speech mechanism easily fills a buffer, and it's then spooled without intervention and with some protection, in order to keep the computer's other secondary background systems from interrupting briefly and thus screwing up the voice timing, which is easily noticed. But that's just speculation on my part.
     
    MorganNews, Mar 28, 2012
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. liljakie13
    Replies:
    7
    Views:
    4,372
    john methew
    Dec 1, 2008
  2. Tony W.
    Replies:
    31
    Views:
    622
    jpmcwilliams
    Sep 8, 2004
  3. lvg4him
    Replies:
    2
    Views:
    212
    lvg4him
    Nov 28, 2005
  4. Donald Smith
    Replies:
    0
    Views:
    272
    Donald Smith
    Feb 17, 2007
  5. Thom White

    You say potato... or Quark.

    Thom White, Sep 14, 2004, in forum: UK Macs
    Replies:
    132
    Views:
    1,615
    Giles
    Sep 18, 2004
  6. Thom White

    You say potato... or Quark.

    Thom White, Sep 14, 2004, in forum: UK Macs
    Replies:
    0
    Views:
    201
    Thom White
    Sep 14, 2004
  7. Rowland McDonnell

    I say, I say, I say

    Rowland McDonnell, May 24, 2007, in forum: UK Macs
    Replies:
    15
    Views:
    372
    Rowland McDonnell
    Jun 5, 2007
Loading...