This function runs a function in a script with a parameter. This will also return a value from the called script.
Scripts must be located in the scripts directory in the HomeSeer application directory (C:\Program Files\HomeSeer 2\Scripts by default).
Parameter: scr
Type: string
Description: This is the file name of the script to run. Do
not include the path in the script name.
Parameter: func
Type: string
Description: This is the name of the function to execute.
Parameter: param
Type: variant
Description: This is a parameter
to send to the function. This
can be a string or numeric value.
Return value: value
Type: variant
Description: This returns any value that the called script returns.
Consider the following script named test.txt:
launch_app(appname)
hs.Launch
appname
' now return some text to the caller
launch_app = "The application is launched"
end sub
The above script could be called using the RunEx call from another script like:
sub main()
dim s
' call the script and get the return value
s = hs.RunEx("test.txt","launch_app","notepad.exe")
' display the returned string
msgbox s
end sub