Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: survex on November 19, 2014, 05:49:45 am

Title: ActiveXObject is not defined
Post by: survex on November 19, 2014, 05:49:45 am
Getting error "ActiveXObject is not defined" executing this script:

!INC Local Scripts.EAConstants-JScript
function main()
{
      var fso = new ActiveXObject("Scripting.FileSystemObject");
}
main();

What am I doing wrong?
Title: Re: ActiveXObject is not defined
Post by: Eve on November 19, 2014, 08:47:50 am
At a guess, you're using the JScript syntax for an ActiveX object inside JavaScript. The example in the help for accessing an ActiveX object from JavaScript is:
Code: [Select]
this.name="Odd Even";
var logger = new COMObject("MySim.Logger");
logger.Show();
logger.Log("Simulation started");
Title: Re: ActiveXObject is not defined
Post by: survex on November 19, 2014, 06:27:03 pm
 :-*
Quote
At a guess, you're using the JScript syntax for an ActiveX object inside JavaScript. The example in the help for accessing an ActiveX object from JavaScript is:
Code: [Select]
this.name="Odd Even";
var logger = new COMObject("MySim.Logger");
logger.Show();
logger.Log("Simulation started");

That's helped, thank you. By the way, do you know how to read file via scripting?
Title: Re: ActiveXObject is not defined
Post by: survex on November 19, 2014, 07:59:34 pm
answered to myself here - http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1416345000