No announcement yet.

Pulling hair w/ what should be simple script!

  • Filter
  • Time
  • Show
Clear All
new posts

    Pulling hair w/ what should be simple script!

    Hello all,

    please help. After 2 hours of trying to create a simple script, I keep running into walls. Finally, I decided to yell "uncle" and post my question.

    I need to get a URL, while passing the variable which is the device status string.

    My device, "Music_Radio1"Selection" [see image] is currently set to "Classical Music". The URL I'd like HS to retreive is:

    Web Page:

    I'm trying to append the URL "/play.php?type=" and the string value from element 1138 which is "Music_Radio1"Selection". For simplicity, I'm using immediate script notation and I've tried the following with no success:
    &hs.GetURL("",("/play.php?name=" & hs.DeviceString(1138)) ,TRUE,8888)

    I've tried "+" instead of the "&" and same results. While there are no errors reported in HS, the web server shows the [VARIABLE] as blank, so the request just ends with "name=". I've searched the forums and tried all sorts of permutations and actual scripts, but then i get different errors, so thought i'd re-focus on back to the basics and ask for help.

    What am I missing or doing wrong?

    thank you,

    Attached Files

    This is a subtle little difference with HS3 compared to HS2, what you think of as the device string (ie Classical Music as displayed in the UI) is not the string, it is actually the status. That status is solely dependent on the devices value, the device string in HS3 is really only used when trying to store complex data (like HTML) in the device UI area.


    &hs.GetURL("",("/play.php?name=" & hs.CAPIGetStatus(1138).Status) ,TRUE,8888)




      It worked. Thank you.