Saving variable in text file issue

Jan 10, 2018

I am using Articulate Storyline 3 Demo version for evaluation purpose. From the following link "https://articulate.com/support/article/javascript-best-practices-and-examples" I am able to see the code to save variable to a text file. The follwing is the JavaScript code I used to trigger while clicking the "Button 1":

var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("D:\\Test.txt", 8, true, 0);
var player = GetPlayer();
var name = player.GetVar("TextEntry");
s.WriteLine("Name: " + name);
s.WriteLine("==========");
s.Close();

I have  set "TextEntry" variable as "Welcome". But when I execute the code nothing happening. What am I doing wrong here? OR Is it due to trial version the variable is NOT saved into a text file? 

I have published as HTML5 content and viewed in a browser, also published as CD version. Both format did not saved variable to the text file. 

4 Replies
Brian Dennis

Alas, this code (circa 2015) no longer works. Modern browsers don't support ActiveXObjects (which was a Microsoft Internet Explorer object). Local system access is considered a security risk. Best options for variables storage are more complex: a) web server running a bit of code, or b) more exotic solutions involving third party solutions like Google Sheets. I opt for the web server and Internet based database.

This discussion is closed. You can start a new discussion or contact Articulate Support.