Determines of running script was launched by BrainVoyager or from outside, i.e. by double-clicking the script in Windows Explorer.
intScriptLaunchedByBV objBrainVoyager.ScriptLaunchedByBV()
Scripts run faster if they are launched by BrainVoyager. One disadvantage is, however, that the "WScript" object is not available for scripts started by BrainVoyager. You can use the presented method to check whether you can access the "WScript" object or not. One important application is the determination of the folder from which a script has been started. (see GetCurrentFolder method).
' VBScript
Set BrainVoyager = CreateObject("BrainVoyager.1")
If BrainVoyager.ScriptLaunchedByBV
Then
path_to_script = BrainVoyager.GetCurrentFolder
End If
// JScript
BrainVoyager = new ActiveXObject("BrainVoyager.1");
if(BrainVoyager.ScriptLaunchedByBV())
path_to_script = BrainVoyager.GetCurrentFolder();
#
PerlScript
$BrainVoyager = Win32::OLE->new("BrainVoyager.1");
if($BrainVoyager->ScriptLaunchedByBV())
$path_to_script = $BrainVoyager->GetCurrentFolder();