Page 1 of 1

Announcing the time

Posted: Wed Feb 26, 2014 11:06 am
by Mag
Hi there!

In your experience, is this a good way to announcing the time?

Code: Select all

on mouseUp
   put "The time is" into a
   put the short system time into b
   revSpeak a && b
end mouseUp
Please, tell me your opinions! :oops:

Re: Announcing the time

Posted: Wed Feb 26, 2014 11:43 am
by Mark
Hi,

Sure, it is a nice way to tell the time. There are many ways to do it. Here's another one:

Code: Select all

constant dot = "."

on mouseUp
   put the english time into myTime
   put the last word of myTime into myDayPart
   delete the last word of myTime
   set the itemDel to colon
   if item 2 of myTime is "00" then
      revSpeak "The time is" && item 1 of myTime && "o'clock" && myDayPart & dot
   else
      revSpeak "The time is" && item 1 of myTime && "hours and" && item 2 of myTime && "minutes" && myDayPart & dot
   end if
end mouseUp
Kind regards,

Mark

Re: Announcing the time

Posted: Wed Feb 26, 2014 12:48 pm
by Mag
Thank you Mark, very nice way to tell the time!