Studio:Instantiating ascript when running a script outside of Studio

From STRIDE Wiki
Revision as of 23:23, 19 June 2007 by Root (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

If you intend to run your script outside of STRIDE Studio (e.g., in Windows), you need to instantiate ascript from within your script. The following example demonstrates how to do this using a sample directory; you will need to specify the directory for your own workspaces in your script.

//Instantiate ascript if you are running a script in Windows
if (typeof(ascript) == "undefined"){
ascript = new ActiveXObject("STRIDE.ascript");
ascript.Initialize("Random Call", "C:\STRIDE\MyWorkspaces\Workspace1.sidb");
}

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