Announcement

Collapse
No announcement yet.

checking my calendar for tomorrow only

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

  • prsmith777
    replied
    A little late to this, but I use the old plugin function like this and it works great.

    Dim tTomorrow as Datetime = Now.AddDays(1)
    Dim tWhen as String = tTomorrow.ToString("d")
    allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEvents", new Object(){myemail,tCalendar,tWhen})

    Leave a comment:


  • Blade
    replied
    No problem

    Leave a comment:


  • mikee123
    replied
    Perfect. Works a treat. Many thanks

    Leave a comment:


  • Blade
    replied
    Install 3.0.52 in the beta section
    I added a new scripting call

    Code:
    hs.PluginFunction("BLGData", "", "GetCalendarEventsForTomorrow", new Object(){"xxx@gmail.com","Holidays"})
    Give it a try and let me know

    Leave a comment:


  • mikee123
    replied
    If I do that it works. But I want to run that event every day and check tomorrows day, so the date
    "04/02/2020" needs to be replaced with a variable to hold tomorrows date

    Leave a comment:


  • Blade
    replied
    Can you use this call

    Code:
    hs.PluginFunction("BLGData", "", "GetCalendarEvents", new Object(){"me@here.com","My Calendar","04/02/2020"})

    Leave a comment:


  • mikee123
    started a topic checking my calendar for tomorrow only

    checking my calendar for tomorrow only

    I have a holiday calendar, and I run this just after midnight to see if the day is a holiday to do various things. Works fine. But now I am trying to check if the next day is a holiday. That does not seem to work.
    When I change
    allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEventsForXDays", new Object(){"xxx@gmail.com","Holidays",0})
    to
    allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEventsForXDays", new Object(){"xxx@gmail.com","Holidays",1})

    and today is a holiday, and tomorrow isnt, it still shows 'holiday found in calendar' in the log

    I have also tried to calculate tomorrows date and putting a variable instead of 0 or 1, but that throws errors

    Code:
    Sub Main(parm as object)
    
    Const ScriptName As String = "SendCalEvents"
    
        Dim allEvents As Object()
    
    Dim Datetomorrow as Date
    Datetomorrow = Today
    
    Datetomorrow = DateAdd ("d", 1, Today)
    
    
    allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEventsForXDays", new Object(){"xxx@gmail.com","Holidays",Datetomorrow})
    
    If allEvents.GetUpperBound(0) = -1
    
               hs.writelog("Info", "No Holiday found in calendar")          
    
               'hs.SetDeviceValueByRef(2035,0,true)
    
    Else
    
               hs.writelog("Info", "Holiday found in calendar")          
    
               'hs.SetDeviceValueByRef(2035,100,true)
    
    End If
Working...
X