Studio:Instantiating ascript when running a script outside of Studio

From STRIDE Wiki
Jump to navigation Jump to search

If you intend to run your script outside of STRIDE Studio, ascript must be instantiated and initialized explicitly from within your script.

The following JScript example demonstrates how to do this using a sample database path; you will need to specify an actual STRIDE database in your script.

// Instantiate an ascript object
var ascript = new ActiveXObject("STRIDE.ascript");
// initialize using the script name and the full path to the database to be used
ascript.Initialize("MyScriptName.js", "C:\\STRIDE\\MyWorkspaces\\Workspace1.sidb");

Refer to the AutoScript's Reference section for more detailed information on the ascript.Initialize method.