Trying to deal with an image caching issue on Jowi's Random Picture script, I thought I might try doctoring the code of a script to make the target filename unique (ie. add a timestamp to the filename) and then dynamically update the hstouch element to load the updated image. HOWEVER, I've really never worked in vbscript before (I'm a beginner at best in perl and python).
With some digging, I've been experimenting with DatePart, Hour, Minute, etc. Only I'm finding that the timestamp seems to be persisting between runs of the script. Here's a simple example:
With the script running every 30 seconds, the resulting output in the log is:
Notice that the first run shows the correct timestamp. However the two subsequent runs show the same timestamp. I'm at a lost as to how to resolve this. Once I resolve this I can reformat the stamp to something useful for the filename. Any suggestions?
regards,
Paul
With some digging, I've been experimenting with DatePart, Hour, Minute, etc. Only I'm finding that the timestamp seems to be persisting between runs of the script. Here's a simple example:
Code:
Dim strDateTime = Now() hs.WriteLog("PictureRandom", "strDateTime is " & strDateTime)
Code:
Oct-10 10:42:40 PM PictureRandom strDateTime is 10/10/2018 10:41:40 PM Oct-10 10:42:40 PM Event Running script and waiting: C:/Program Files (x86)/HomeSeer HS3/scripts/JOWI_PictureRandomHallway1.vb Oct-10 10:42:40 PM Event Event Trigger "Hallway Rotate Hallway Screensaver" Oct-10 10:42:10 PM PictureRandom strDateTime is 10/10/2018 10:41:40 PM Oct-10 10:42:10 PM Event Running script and waiting: C:/Program Files (x86)/HomeSeer HS3/scripts/JOWI_PictureRandomHallway1.vb Oct-10 10:42:10 PM Event Event Trigger "Hallway Rotate Hallway Screensaver" Oct-10 10:41:40 PM PictureRandom strDateTime is 10/10/2018 10:41:40 PM Oct-10 10:41:40 PM Event Running script and waiting: C:/Program Files (x86)/HomeSeer HS3/scripts/JOWI_PictureRandomHallway1.vb Oct-10 10:41:40 PM Event Event Trigger "Hallway Rotate Hallway Screensaver"
regards,
Paul
Comment