The following documents and its link will explain where script execution begin and where events come and go.
The first thing that it is done after the BlueJscript extension is loaded is to look for the first and initial command. It is important to note that it is a command and not a filename where to load commands from. The initial command can be anything or even a few commands one after the other, the essential thing is that it fits one line.
The initial command may come either from a command line or the Preference panel. An example of both will clarify the matter.
The following example will show how to start blueJ by a command line and pass some paramteres to it. It is a visual basic script and works under Windows XP, but once you grasp the concept you will be able to start BlueJscrip with a profile anywhere you wish.
The most important thing is starting java with a property defined, this means looking for -Dbluejscript.profile="'+profile+'" in the above line. Again the proper use of single and double quotes is absolutely relevant So the above script will start BlueJ and will define a property called bluejscript.profile that holds the first command that BlueJscript will execute. In the example above it will be a load command.
If no profile command is passed at startup BlueJscript will look into the user bluej directory for a file called profile.js. If this file is found it will be loaded at bluejscript startup.
If no user profile is defined then the profile that is bound with the project is executed. Again the file being looked is called profile.js. It is important to note that no provision is made for concurrent execution and one script will be executed only if the previous one terminates.
The command being executed at startup may or may not finish its execution. It may finish it if it is something simple like jsConsole.setVisible(true); or may not finish if it is a script that constitues a faull tutorial that will close at the end.
In any case, to interact with the console you need to see it, if there is no console visible and no way to show it (es: by means of a button) then you can only obey to what the script is asking you. To get the console you need to step out of the script by starting BlueJscript with a different startup command.