Running Scripts from the Command Line
You can run scripts from a command prompt without having to manually load and execute the script in Scripter. The same commands that you would type at a command prompt may also be entered as the "target" for a shortcut in order to link a shortcut button to a script. Enter the following to run a script from the command line or to link a shortcut to particular script file:
<Scripter path> -x filename.bas
where <Scripter path> represents the path to the Scripter program file (for example, C:\ Program Files\Golden Software\Grapher\Scripter\Scripter.exe") and filename.bas represents the name of the script to run. The space between the –x and the file name is required. This command opens theScripterwindow, loads the specified script file, and runs the specified script. When the script terminates - either successfully or unsuccessfully - theScripterwindow closes.
To load a script file but not execute it, the following command can be used:
<Scripter path> filename.bas
This opens the Scripter window and automatically loads the specified script file. The Scripter window remains open.
Passing a Command Line Argument to the Script
A single command line argument can be passed to a script. The command line argument can be any text that is used in the script. For example, a file name can be passed and used to create a graph. Enter the following to run a script with a command line argument:
<Scripter path> -x filename.bas command
where command represents the commands that should be passed to the script. Access the command line argument from the script using the Command$ option. For example, if the script name is variable.bas and it can be run with any data file, you could use:
"c:\program files\golden software\Grapher\scripter\scripter.exe" -x "c:\temp\variable.bas c:\temp\data.dat"
Do not quote the arguments in the command. To use the data in the script, use:
'Return the argument to the Immediate window
Debug.Print Command$
'Create a line/scatter plot from the data
Plot1.Shapes.AddLinePlotGraph(Command$)