AnsweredAssumed Answered

Using a javascript to create a custom metric from external text file

Question asked by jamescpilker1317592 on May 2, 2012
Latest reply on Jun 9, 2012 by Hiko_Davis
I've taken one of the example Javascripts, cut it down to create a customer metric. I set "var processVal = 100; " and I see 100 on my custom metric in the EM. Works great.

I'm new to Jscripts. I have a file containing a single number. I would like to read that file and proagate processVal with the number.

Nothing I've found on the internet has worked. How can I read a text file using the Javascript feature Wily supplies?

I found this but can't get it to work.

var fsoObject = new ActiveXObject("Scripting.FileSystemObject");
var inputFile = fsoObject.OpenTextFile("c:\\java\\uow1.txt", 1, "True");
reportFile = inputFile.ReadAll();
inputFile.Close();

Any ideas?

Outcomes