View Single Post
Old 10-24-2016, 07:09 PM
b_rianv b_rianv is offline
Join Date: Sep 2014
Posts: 13
Default Speaking time Windows

Good evening,

I am working with this code and I am getting this error,can someone help?

Script speak2.vbs
Line 9
Char 59
Error Unterminated string constant
Code 800A0409
Source Microsoft VBScript compilation error

Here is the code

Dim sapi,hr,ampm,wish
Set sapi = CreateObject("sapi.spvoice")
end if
end if
if(hour(now)<12)then ampm="AM end if if(hour(now)?12) then
end if
select case hour(now)
case 0: hr="12"
case 1: hr="1"
case 2: hr="2"
case 3: hr="3"
case 4: hr="4"
case 5: hr="5"
case 6: hr="6"
case 7: hr="7"
case 8: hr="8"
case 9: hr="9"
case 10: hr="10"
case 11: hr="11"
case 12: hr="12"
case 13: hr="1"
case 14: hr="2"
case 15: hr="3"
case 16: hr="4"
case 17: hr="5"
case 18: hr="6"
case 19: hr="7"
case 20: hr="8"
case 21: hr="9"
case 22: hr="10"
case 23: hr="11"
end select
if(hour(now)>=0 and  hour(now)<12 then wish="Good Morning Brian" end if if(hour(now)>=12 and hour(now)<=17)
then wish="Good Afternoon Brian" end if if(hour(now)>17 and hour(now)<=23) then wish="Good Evening Brian"
end if 
sapi.Speak wish+". Brian, the time is "+ hr+" "+ampm
Thank you,
Reply With Quote