Introduction

You can set a Automatic File Type Association in Windows in a way that BrainStim is the default program that Windows uses when you open a particular type of file. The next time when you execute a file of that type it is automatically opened by BrainStim.

Example

Let's configure a File Type Association in Windows to let script files (*.qs file) automatically be opened in BrainStim.

  1. Set the File Type Association for a script file (*.qs file) for BrainStim by using the online Microsoft documentation (and skip step 2), or perform below step 2.
  2. - Right click on a script file (*.qs file), for example the QtLibraryScriptBindings.qs file that is located in the Main Program Directory subfolder /Examples\Script.
    - Select the menu option Open with and then Choose default program...
    - Make sure that the option Use this app for all .qs files is checked and expand (More options) and select Look for another App on this pc and browse to the BrainStim Executable (BrainStim.exe) file in the Main Program Directory.
  3. Open another script file (*.qs file) and notice that this file is then automatically opened by BrainStim.
  4. Now uncheck the BrainStim setting Allow multiple instances of BrainStim, read this document on how to do this, and open again another script file (*.qs file) that is not currently opened in BrainStim. Notice that the script file is now loaded in a new instance of the BrainStim application.
  5. Check (enable) again the Allow multiple instances of BrainStim setting and once again open another script file (*.qs file) that is not currently opened in BrainStim and notice the logging that appears in the default Output Log Tab:
	-> SocketData Received [Log("New BrainStim Instance Initializing...");]
	New BrainStim Instance Initializing...
	-> SocketData Successfully executed by the Script Engine.
	-> SocketData Received 
	[BrainStim.openFiles(null,["E:/Projects/BrainStim/Install/Examples/BrainStim/QtScript Includes/QtLibraryScriptBindings.qs"]);]
	-> SocketData Successfully executed by the Script Engine.
	-> SocketData Received [BrainStim.activateMainWindow();]
	-> SocketData Successfully executed by the Script Engine.