• 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: applescript SAY command help needed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript SAY command help needed


  • Subject: Re: applescript SAY command help needed
  • From: dealTek <email@hidden>
  • Date: Mon, 13 Aug 2012 21:20:03 -0700


On Aug 8, 2012, at 5:02 AM, Chris Page wrote:


You can interrupt the "say" command with Command-Period when the script is running in the foreground (on the main thread).

By default, when you run scripts inside Script Editor they're run in the background so you can continue to interact with Script Editor while scripts are running—and you can run multiple scripts simultaneously. To force Script Editor to run scripts in the foreground, press the Control modifier key so the Script > Run command becomes Run in Foreground.

Note that Script Editor is primarily intended as a development environment rather than the normal way to run scripts once they're written and tested. You should typically either save scripts as applications or invoke them from the system Script menu (or similar mechanisms). When run that way, they are run in the foreground and Command-Period will interrupt scripts on a more fine-grained basis.

Also note that even if you interrupt the "say" command, the speech itself continues, since speech synthesis is performed in another process while the "say" command waits for it to complete. Interrupting "say" just stops it waiting for the speech to finish. If you want to explicitly stop the speech in response to Command-Period, catch the "user canceled" error (-128) produced by Command-Period and then tell "say" to stop any current speech:

try
say "A long speech message that you can stop midway through."
on error number -128
say "" with stopping current speech
end try

-- 
Chris Page

 The other, other AppleScript Chris



Sorry for the late response - (I just saw this……..)

Thanks so much for this info Chris - I'm going to check it out right now…...





--
Thanks,
Dave - DealTek
email@hidden
[db-12]

 _______________________________________________
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: applescript SAY command help needed (From: Chris Page <email@hidden>)

  • Prev by Date: Re: Mail's mailbox list
  • Next by Date: add a new iCal event from an FMP record - adding display alarm not working yet
  • Previous by thread: Re: applescript SAY command help needed
  • Next by thread: Re: Using New High Quality Voices in Lion with Applescript control
  • Index(es):
    • Date
    • Thread