csInterface.evalScript not working correctly
Hi guys. I am pretty much stomped on this one. I am sure I'm making a mistake but I can't see it. Maybe more eyes will help.
Here's what is happening:
I get ad alert from LogRead JSX function on startup which is blank. This works just fine. The second time on a triggered event in the main.js it does not alert which means it's not working, nothing happens
Here's the code snippets:
MAIN.JS - ON START UP
csInterface.evalScript('LogRead(\'\',' + logfilepathname + ')');
HOSTSCRIPT.JSX
//save a text file or write new data
function LogRead(newfiledata,filepathname){
//read data
alert(newfiledata);
var vfiledataread = FileDataRead(filepathname);
if(vfiledataread == ""){
//create settings file if not created
FileDataCreate("theme: Default__",filepathname,"w");
};
if(newfiledata > ""){
//write update new data to file
FileDataCreate(newfiledata,filepathname,"e");
};
};
MAIN.JS - ON EVENT TRIGGER
csInterface.evalScript('LogRead(' + newstreamdata + ',' + logfilepathname + ')');
Advice appreciated, thanks!
