I am trying to read some information back to a javascript file in a CC extension panel. I am trying this which according to all the samples and documentation should work.
>> js/host/main.js
var getEnvironment = function(){
var res = "1234";
writeLn('returning '+res);
return res;
};
>> js/main.js
function onLoaded() {
var csi = new CSInterface();
csi.evalScript("getEnvironment()", function(result) {
console.log(result);
});
};
When I load the extension, I can see the line "returning 1234" displayed in the info panel. However the console.log(result) will not print out the value. What am I doing wrong? This is as simple as it gets and I just cant get it to work!
Please help.