I'm trying to write the following to a text file {"state":"closed"}
This is the script I'm using
sub main(sVal)
Dim fso,f1
Const OpenFileForReading = 1
Const OpenFileForWriting = 2
Path = "html/garagedoorstatus.html"
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile(path, 2,True)
file.WriteLine (" {"state":"closed"} ")
file.Close
end sub
but when I run it I get an error......
Running script, script run or compile error in file: GARAGEDOORCLOSED1006:Expected ')' in line 13 More info: Expected ')'
Seems like it doesn't like the quotes on either side of the state and closed?
When I take those out it runs just fine, should there be something else in there because of the extra quotes?
This is the script I'm using
sub main(sVal)
Dim fso,f1
Const OpenFileForReading = 1
Const OpenFileForWriting = 2
Path = "html/garagedoorstatus.html"
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile(path, 2,True)
file.WriteLine (" {"state":"closed"} ")
file.Close
end sub
but when I run it I get an error......
Running script, script run or compile error in file: GARAGEDOORCLOSED1006:Expected ')' in line 13 More info: Expected ')'
Seems like it doesn't like the quotes on either side of the state and closed?
When I take those out it runs just fine, should there be something else in there because of the extra quotes?
Comment