Announcement

Collapse
No announcement yet.

How to set a device string to include the current time?

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

    How to set a device string to include the current time?

    OK, I want to set a device string to say: Front Door Last Opened at: 12:45pm. How do I script this?

    This is what I currently have (which doesn't work):

    &hs.setdevicestring "d4","Front Door Last Opened at: &time"

    Any ideas?

    #2
    But change it to:
    &hs.setdevicestring "d4","Front Door Last Opened at: " &time

    You going to find that the time function actually provides too much info.

    If you want to 'clean it up' a bit let me know and I can post a small bit of a script I use to show the time in a more 'readable' format.

    Dan-O
    My system specs are in my profile
    (Current beta as always)

    Comment


      #3
      Thanks, Dan-O! That works great. Now can I bother you to ask how I would add the date too? I tried this:

      &hs.setdevicestring "d3","Front Door Last Opened at: " &time on &date

      But that doesn't do it. Any ideas?

      Thanks for your help!

      Comment


        #4
        Change it to:
        &hs.setdevicestring "d3","Front Door Last Opened at: " &time &" on " &date

        See the difference?

        Dan-O
        My system specs are in my profile
        (Current beta as always)



        Comment


          #5
          &hs.setdevicestring "d3","Front Door Last Opened at: " & now

          -Rupp
          ...One Nation Under GOD, Indivisible, With Liberty And Justice For All.
          -Rupp
          sigpic

          Comment

          Working...
          X