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
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.
|