I am getting the following error in HS4 when I try to run this one line script, either in an event action or in the Tools/Script Command page:
Running script(2) & If hs.GetListenStatus ("Audrey11efault") Then hs.SetDeviceValueByRef (1285, 100, True) Else hs.SetDeviceValueByRef (1285, 0, True), init error: Syntax error
Oddly this one-liner is very similar to the example of a one-liner given in the help file. I have tried with parentheses and without, I've tried appending with nhs, I've tried SetDeviceValue and SetDeviceValueByRef, but I always get a syntax error. If I run the component pieces of the statement, they execute fine alone or in another If statement, but for some reason I cannot seem to get this combination to run.
I'm simply trying to toggle a virtual device to indicate whether voice recognition is listening or not.
I appreciate any advice.
Running script(2) & If hs.GetListenStatus ("Audrey11efault") Then hs.SetDeviceValueByRef (1285, 100, True) Else hs.SetDeviceValueByRef (1285, 0, True), init error: Syntax error
Oddly this one-liner is very similar to the example of a one-liner given in the help file. I have tried with parentheses and without, I've tried appending with nhs, I've tried SetDeviceValue and SetDeviceValueByRef, but I always get a syntax error. If I run the component pieces of the statement, they execute fine alone or in another If statement, but for some reason I cannot seem to get this combination to run.
I'm simply trying to toggle a virtual device to indicate whether voice recognition is listening or not.
I appreciate any advice.
Comment