JavaScript - Username variable into a file
Aug 01, 2014
Hello,
I have a trigger which executes JavaScript when a button is pressed. The JavaScript is supposed the take the name that the user entered previously and write it to a txt file (eventually a csv if possible). For some reason, it's like the trigger is never activated no matter how many times you press the button. I have it set to create the file if it does not exist and it will not create the file. I also tried creating a blank txt file but there was not a name added to it when I ran the program. I am trying to run this on IE8 (yes, I know, it's so old but we have to use this one) and I checked all the settings which look fine to me, unless I've missed something. I have the JavaScript below, I've done a lot with Java but this is my first time using JavaScript.
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("S:\QC\profiles\krissymiller\Test.txt", 8, true, 0);
var player = GetPlayer();
var name = player.GetVar("Username");
s.WriteLine("Name: " + name);
s.WriteLine("==========");
s.Close();
1 Reply
I got this working, but now how do I get it into an excel document?
This discussion is closed. You can start a new discussion or contact Articulate Support.