Announcement

Collapse
No announcement yet.

Google Calender script from HS2 to HS3

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    No not really, one thing to try is actually copying that URL into a browser and seeing if a page comes up, you are looking for a page of data rather than a load of errors.

    The next thing to try is the URL from before trying that in both calendars and seeing whether or not you can get the data twice, if you can then something is wrong in the other calendar. Whilst I have never tried pulling two bits of data from different users I can't see it being a problem.

    Comment


      #32
      Google Calender script from HS2 to HS3

      Ok thanks. Will try what you suggested. Will let you know how I get on.

      Thanks again for your help :-)


      Steve
      Steve

      Comment


        #33
        Google Calender script from HS2 to HS3

        Mr happy

        Could you possibly email me the code. As Jon suggested in previous posting , perhaps it's got corrupted in the copy and paste translation.

        Thanks


        Steve
        Steve

        Comment


          #34
          I've sent it you, I don't think it is a problem with the copy and paste as if it was then I would expect a syntax error (I mean I could be wrong). Did you manage to browse the URL and see what came up?

          Comment


            #35
            Thanks mrhappy

            Sorry for late reply, been out today.

            yes received with thanks. I managed to copy URL into browser and get google info displayed. Think I found out what the problem was. It was upper case letter in the password field that should of been lower Case

            Yes, managed to get it to work reading two calenders now.

            Just would like to call on your expertise one more time if I may

            Only thing I would like to change is to add a pause between the two calendar announcements. For example "steve, you have dentist tomorrow" (calendar one) Then a pause, then read calendar two announcements.

            Is that something easy to do ?

            Muchly appreciated
            Steve

            Comment


              #36
              You can read calendar #1 then calendar #2 with a pause yes, it would be difficult to read the two merged together though (like first item from one calendar, then first from second, then second from first, second from second etc) because you might have different numbers of items in each calendar.

              If you want to pause between the two look for this line

              Call Wife(Nothing)

              and add something like

              Thread.Sleep(2000)

              before it so it looked like

              Thread.Sleep(2000)
              Call Wife(Nothing)

              and then it should wait two seconds before reading the second calendar. You can adjust the 2000 figure to suit you.

              Comment


                #37
                Steve:

                This function causes TTS to pause. Hope it helps.

                PHP Code:
                Function myPause(ByVal myInt)'This functions formats TTS pause
                    myPause = "<silence msec=" & Chr(34) & myInt & Chr(34) & "/>"
                End Function 
                Don

                Comment


                  #38
                  Google Calender script from HS2 to HS3

                  Great stuff, mr happy

                  Thanks

                  Will add the line and see how it goes.

                  Don, just out of curiosity ,

                  How would you incorporate that line in the script?

                  Would be nice to add a pause between announcements on the same calender.

                  I wish I understood a bit more about scripting :-(


                  Steve
                  Steve

                  Comment


                    #39
                    Steve:

                    If you are having your events spoken in a string, you would insert the pause where ever you wanted it.

                    "Blah blah blah" & myPause(600) & " more blah."

                    Does that make sense to you?
                    Don

                    Comment


                      #40
                      subscribed. This is great info.

                      Thanks!

                      Comment


                        #41
                        Google Calender script from HS2 to HS3

                        Originally posted by mrhappy View Post


                        hs.speak("Tomorrow at " & convert.todatetime(feedEntry.Times(0).StartTime).tostring("H H:mm") & " you have " & feedEntry.Title.Text)
                        thread.sleep(500)
                        End If


                        End Sub[/code]

                        Thanks Don

                        Yes, that makes sense. Mr happy has posted a great script and just want to take this opportunity to thank him, it works really well.


                        I added the thread.sleep where he suggested and it works fine, it splits the two diary entries as I wanted.

                        As mr happy quoted above I also tried changing the thread.sleep(500)

                        Hoping that would do the same thing but it does not seem to make any difference . I was also trying here to increase the pause between the " calender one" diary announcements .

                        For example

                        "Steve has dentist at three " ADD LONGER PAUSE HERE " Steve has shopping at four"

                        So not sure where you insert the my pause statement as it would have to be in the script and not in the speech brackets ??????

                        Just to finish it off nicely ( like my original google calender script)

                        Would be for it to announce " you have no more appointments" when the script has finished running.

                        I have tried adding something like ("hs.speak " you have no more appointments" )

                        At the end of the script but that's just clutching at straws rather than I know what I'm doing!,

                        Thanks , any suggestions, I'm nearly there....




                        Steve
                        Steve

                        Comment


                          #42
                          Potentially my fault that one, I think what is happening is the thread.sleep command is being run as the hs.speak command is and as such you don't hear the 0.5 second gap. The correct or a better method is indeed to use SAPI tags as Don has said (there is also the ability to add a second parameter to the hs.speak command to wait for it to finish before it returns but this method is best if you want to add more time). So it should look like this (remove the thread.sleep).

                          hs.speak("Tomorrow at " & convert.todatetime(feedEntry.Times(0).StartTime).tostring("H H:mm") & " you have " & feedEntry.Title.Text & "<silence msec=""500""/>")

                          At the end of the For...Next loop and before you call the second calendar add

                          hs.speak("You have no more appointments today",True)

                          or

                          hs.speak("You have no more appointments today<silence msec=""500""/>", True)

                          If you want to add a call to say that days calendar is over before running the next one.

                          Comment


                            #43
                            Google Calender script from HS2 to HS3

                            Originally posted by mrhappy View Post

                            At the end of the For...Next loop and before you call the second calendar add

                            hs.speak("You have no more appointments today",True)

                            or

                            hs.speak("You have no more appointments today<silence msec=""500""/>", True)

                            If you want to add a call to say that days calendar is over before running the next one.
                            No problem. I appreciate you taking the time to help.

                            I can't see in the script where to add this line you are on about.

                            Thanks



                            Steve
                            Steve

                            Comment


                              #44
                              You put it after the word next and before the Call Wife(nothing) line in the first script and then just after the word next in the second script. There is only one For...Next loop in the middle of each script.

                              Comment


                                #45
                                Google Calender script from HS2 to HS3

                                Yep, I understand, thanks. I will give it a go tomorrow . See if I can break it :-)



                                Steve
                                Steve

                                Comment

                                Working...
                                X