Working with scripts in BrainVoyager

Although you can define and run your scripts completely outside of BrainVoyager, we provide special scripting support in form of a sizeable, colour-coding script editor, debugging help by localization of the code line producing a script error and a dialog to organize and manipulate scripts from all three currently supported scripting languages. To call the Scripts dialog, either click the "File->Scripts..." menu item or click the Scripts icon in the Toolbar.

The Scripts dialog shows all script files in the current folder; the path of the current folder is shown in the dialog's title bar. To select files from a different directory, use the Browse... button. You can create an empty new script using the New... button and you can delete a script from the current folder using the Delete button. You can also run the script selected in the dialog directly from BrainVoyager using the Run button. You can also inspect and modify a selected script in the Script Editor dialog. To invoke the editor, select a script and then click the Edit... button. The figure below shows the Script Editor dialog containing a simple script. The yellow arraw in the left margin points to a line which produced an error when the script was started. The error is a simple typographic one, i.e the line should be "doc.ShowGLM". If you would correct the error, the correct name would immediaely coloured blue as are all methods and properties exposed by BrainVoyager.

You can edit your script within this editor as with any other text editing program, i.e. you can cut, copy and paste text using the standard Windows keys or you right in the editor to get a local file menu containing menu items for cut, copy and paste. In the right column, the position of the cursor in the text is shown in the Line and Col fields. You can quit the editor without saving modifications made by clicking the Cancel button. To save modifications, use either the Save button or the Save As... button. If you want to save the current script as well as immediately executing it, use the Save & Run button.
The script editor uses colour-coding to highlight different types of information; keywords of the scripting language are coloured red as default while methods and properties (called "functions" in the options dialog) of COM servers like BrainVoyager are coloured blue. You can change these colors as well as colours for other categories like stings, numbers and comments using the Script Editor Options dialog which you can invoke by clicking the Options... button.