Announcement

Collapse
No announcement yet.

How to use the Script Element

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    I tried and tried to figure out how to use this action with a static command, and not pass a homeseer element and finally figured it out:


    Open the action dialog
    Add the following:
    Action Type: Run a homeseer script with values from controls
    Script: &hs.runex("script_name","function_name","parameter")
    Script procedure: Ignore

    When you close the dialog it will add "Main" to the script procedure, but it seems to be ignored.

    You can also just run a command directly like in the web interface:
    Script: &hs.speak "this is a test"

    or

    Script: &hs.sendir command

    The confusing part is that you don't HAVE to select a script from the dropdown, and you don't have to pass a parameter.

    Comment


      #32
      Rupp,

      Don't you have to be signed up for paid support to submit a help desk ticket now?

      Comment


        #33
        From Rich's post:

        HomeSeer Support Changes
        Effective immediately, we are implementing a number of changes to our technical support system. These changes are being done to allow us to handle support issues more efficiently and offset some of the ongoing costs involved with providing support. Users have asked for some form of priority support, and this is our solution. Questions posted here are addressed as quickly as possible. We are striving to post a response within one hour, during normal business hours. We will do our best to answer questions after hours and on weekends. Response times will vary during these time.

        What is changed:
        1) The current help desk will be modified to handle pre-sales questions, order issues, product returns, and licensing issues only. It will no longer be used for technical support.

        Comment


          #34
          Originally posted by mterry63 View Post
          Rupp,

          Don't you have to be signed up for paid support to submit a help desk ticket now?
          Yes.
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #35
            Originally posted by Rupp View Post
            Ok, I was able to get this to work. I put a text box on the form and then used a seperate button to send the value entered in the text box. The script is :
            Sub Main(sVal)
            msgbox(sVal)
            End Sub
            nice job.... here is a question how do u do it with multiple input boxes

            Comment


              #36
              Originally posted by ~Ghost~ View Post
              nice job.... here is a question how do u do it with multiple input boxes
              When you pass multiple parameters into a script from HSTouch then it is split by a character, Chr(7) IIRC. In your script you will need to split the parameter by this character to create a string array, in that array you will have you multiple inputs in the order they are specified in the HSTouch run a script action box.

              Comment


                #37
                thank you for being so patient with me i do appreciate all the help.. i'm really really new to scripting

                so do i put the Char 7 into the text field i'm lost

                ~Ghost~

                Comment


                  #38
                  Originally posted by ~Ghost~ View Post
                  thank you for being so patient with me i do appreciate all the help.. i'm really really new to scripting

                  so do i put the Char 7 into the text field i'm lost

                  ~Ghost~
                  I may be slightly wrong on that one sorry, it will depend on what sort of parameter you are sending into HSTouch. If you are looking at using list boxes then you may need to think of a split as the labels and the values are split by what looks like a box symbol but is the ASCII character 7.

                  I think if you are simply using text input boxes you will be OK with something like below;

                  Code:
                  Sub Main(ByVal Parms As Object)
                  
                  hs.writelog("Test", "This is parameter 1: " & Parms(0).ToString)
                  
                  hs.writelog("Test", "This is parameter 2: " & Parms(1).ToString)
                  
                  End Sub
                  Try that and see what gets sent to the log and whether it is what you are expecting.

                  Comment


                    #39
                    yes that is what i need it to do however i keep getting this message. i messed around with it for a hour or so but couldn't get it to stop thowing up this message
                    7/23/2012 12:57:44 AM - Error - Running script, script run or compile error in file: NewEvent.txt1006:Expected ')' in line 1 More info: Expected ')'

                    Comment


                      #40
                      Originally posted by ~Ghost~ View Post
                      yes that is what i need it to do however i keep getting this message. i messed around with it for a hour or so but couldn't get it to stop thowing up this message
                      7/23/2012 12:57:44 AM - Error - Running script, script run or compile error in file: NewEvent.txt1006:Expected ')' in line 1 More info: Expected ')'
                      Change the file extension to .vb and try that...

                      Comment


                        #41
                        i changed the file extension from .Txt to .VBS but still got the same error message.

                        Comment


                          #42
                          Originally posted by ~Ghost~ View Post
                          i changed the file extension from .Txt to .VBS but still got the same error message.
                          Try just .vb not .vbs, .txt/.vbs files are VBScript, .vb are executed as vb.net files - that script bit I wrote is a vb.net script (generally you can identify a vb.net script easily by the parameter, vb.net scripts declare the parameter as a type whereas vbscript does not).

                          Comment


                            #43
                            THANK YOU MR HAPPY!!!!!! you rock <>

                            ~Ghost~

                            Comment

                            Working...
                            X