On this Page

    Predefined Vars

    When RunScript executes, all the $X settings that are defined either explicitly or by default on the command line are made available as pre-defined javascript variables. (All DocOrigin programs automatically include the Default-DocOrigin.prt). So, for example:

    var fn = $E + "/Default-DocOrigin.prm";
    _message("fn=%s", fn);     // displays "fn=c:/DocOrigin/DO/Bin/Default-DocOrigin.prm"

    All the parameters set on the command line of RunScript are also available within the script as the javascript object _job.command. So for example:

    _printf("script=%s", _job.command.script); // will display -script setting

    RunScript allows you to set any command line options of your own. Consider the following file "myscript.wjs" contains

    _printf("mydata=%s", _job.command.mydata); // display command option -mydata

    Running RunScript -script myscript.wjs -mydata=Fred.txt
    will print "mydata=Fred.txt".