• 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: Use "say" from a background user account?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use "say" from a background user account?


  • Subject: Re: Use "say" from a background user account?
  • From: Stan Cleveland <email@hidden>
  • Date: Wed, 05 Nov 2014 13:03:54 -0800

On Nov 5, 2014, at 12:00 PM, Rob Lewis wrote:

Great idea, Stan. Thank you! 

No problem. Glad to help out.

Do you think there’s any reason one couldn’t use a Folder Action Script to do basically the same thing? 

Yes. Folder action scripts don't always get launched by the triggering action. But in my 10+ years of doing process automation, I've found stay-open, idle-handler applications to be rock solid and reliable. Depending on memory usage, such scripts require only periodic Mac reboots, from once a day to once a week.

Also, oddly, I’ve noted that SOMETIMES speaking from the background account works. Bug or feature? Who knows? 

Yes, and folder actions SOMETIMES work. Use methods you can count on.

What I’m using right now in the background script is this: 
do shell script “say \”some text to speak\” &>/dev/null &” 

That stuff at the end is some voodoo I found somewhere that’s supposed to let the speech run without holding up script execution. But just to make sure, I wrapped it in an “ignoring application responses” block (belt & suspenders, for sure!) 

Whatever works—and I mean that literally. When considering a technique new to me, my tendency is to do research or testing to pin down exactly what it does. Then, I keep it only if it adds value to the situation. 

For an example, try testing the following two variations of your background script:

repeat 10 times
do shell script "say \"some text to speak\" &>/dev/null &"
end repeat

repeat 10 times
do shell script "say \"some text to speak\""
end repeat

The first one will allow all ten instances to be spoken at virtually the same time. The second will speak the ten instances one after the other, in orderly fashion. 

The "ignoring application responses" control statement seems to have no effect at all on this particular command, probably because "do shell script" is from a scripting addition, rather than an actual application.

I wish you the best with your project!

Stan C.

 _______________________________________________
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: Use "say" from a background user account? (From: Rob Lewis <email@hidden>)

  • Prev by Date: Re: Use "say" from a background user account?
  • Next by Date: [ANN] Update to ASObjCextras.framework
  • Previous by thread: Re: Use "say" from a background user account?
  • Next by thread: Smile Toolbar Buttons
  • Index(es):
    • Date
    • Thread