I am trying to pass the value of a label into a HS Script. I have tried two methods, and neither seem to work.
I started by selecting my ActionType to be Run a HomeSeer script with values from elements. Then selected the VB script that I want to run from the drop down list. Typed in the function within the script (in this case Main), and finally, selected the label element from the drop down list of available elements. The receiving script looks as follows:
Sub Main(ByVal parm As Object)
The value of Val is always blank.
Then I tired a different approach. I tried passing the text value of the label element into a script on the command line using the following syntax:
&hs.RunScriptEx "File.vb","Main",[$ELEMENT=screen_name->label_element]
The receiving script in this case has been changed as follows as this should only be passing in a string:
Sub Main(ByVal parm As String)
When I try this method, I simply get a Script Error message appearing in the HS Log.
I have no idea what I am doing wrong, but I am sure it is something really stupid. I am updating the text of a label element based on certain conditions, and I simply want to pass the current text string into a HS script, and have it act accordingly.
Any assistance would be greatly appreciated!
Cheers,
George
I started by selecting my ActionType to be Run a HomeSeer script with values from elements. Then selected the VB script that I want to run from the drop down list. Typed in the function within the script (in this case Main), and finally, selected the label element from the drop down list of available elements. The receiving script looks as follows:
Sub Main(ByVal parm As Object)
Dim Val As String
Dim splitString As String()
splitString = Split(parms, char(7))
Val = splitString(0)
End SubDim splitString As String()
splitString = Split(parms, char(7))
Val = splitString(0)
The value of Val is always blank.
Then I tired a different approach. I tried passing the text value of the label element into a script on the command line using the following syntax:
&hs.RunScriptEx "File.vb","Main",[$ELEMENT=screen_name->label_element]
The receiving script in this case has been changed as follows as this should only be passing in a string:
Sub Main(ByVal parm As String)
Dim Val As String
Val = parm
End SubVal = parm
When I try this method, I simply get a Script Error message appearing in the HS Log.
I have no idea what I am doing wrong, but I am sure it is something really stupid. I am updating the text of a label element based on certain conditions, and I simply want to pass the current text string into a HS script, and have it act accordingly.
Any assistance would be greatly appreciated!
Cheers,
George
Comment