A little fun here today, its Friday after all.
10.5.x Leopard has a much improved and understandable Text-To-Speech system and a new voice called Alex. Alex can and will say stupid (and useful) things to you and others if you just command it. If you dare, man page the ‘say’ command in the Terminal/iTerm.app vt100 environment.
Here we have a not so big challenge, announcing the time and suggesting doing something else for a bit is a good thing for those of us that sit at the computer far far far too long at spells. With the healthy problems computer professionals have, RSS, pooling of blood in the extremities (particularly the legs), shoulder problems and even eye strain issues this little ditty does the job well to remind me to shower :). I laugh, and think about how it is a good thing its just a computer telling me to take a rest and not some nagging impotent boss from “The Office” or “The Drew Carey Show”.
get the time
if the hour is zero then -- announce for first hour of day what day it is.
shell "say Today is " & the long date
put "00" into chars 1 to 2 of it -- correct a bug with say command
end if
shell "say The" && \
any item in ( "bleeping", "freaking", "", "darn", "lovely" ) && \
"time is" && it && \
any item in ( ", so", ", " ) && \
any item in ( "wake up", "make a change" ) && \
any item in ( "and", "or", "exclusively or", "in a boolean fashion and" ) && \
any item in ("possibly", "maybe", "definitely") && \
" you" && \
any item in ("should", "would", "could") && \
any item in ( "think about", "contemplate, to consider, to evaluate, to decide on", "deciding on" ) && \
any item in ( "taking", "doing", "exiting and doing" ) && \
any item in ( "a cup of" & \
any item in ( "java", "coffee", "tea", "soda", "water" ), "a walk", "some sleep", "a bit of rest", "a" && \
any item in ( "hot", "cold", "warm", "boiling", "freezing", "" ) && \
"shower", "dinner", "lunch", "breakfast", "a meal" )
You could include this in an .st or .script file, and direct either your embedded ST application to run it, or even talk to Thoughtful Software (http://www.thougthful.com) about other means of executing SenseTalk (http://www.sensetalk.com) scripts from the CLI. I run it as an .st script, and let Cronnix (http://www.abstracture.de/projects-en/cronnix) do the scheduling.
Either way this is a good and fun way to remind us that we need to take a few mins every 30 to 60 mins and stretch and exercise something other than our brains.
Try this on for size:
shell "say super calla fragia listic expee alla docious"
And finally you can leverage all this for announcements that change due to failures or success in your scripts and environment.
try to do Something
sayRunStatus the exception
try to do "Something(goAheadAndFail)"
sayRunStatus the exception
to sayRunStatus e
if e.name is empty then
shell "say" && "SUCCESS, your scripts works fine!"
else
Log e.name && "-" && e.reason
shell "say" && "Uh oh, you have encountered a problem."
shell "say The Exception information follows"
wait 1 second
shell "say" && e.name && e.reason
end if
end sayRunStatus
to something trigger -- do nothing but throw an exception
if trigger is not empty then
Throw "Some Type of Exception", \
"Please place exception information here, which should be detailed."
end if
return "goodness"
end something
Enjoy, and have a great time with your SenseTalk’ing (literally)