This function is called just before the start of the main processing loop, after the initial target list of targets to process has been compiled.

This is a good place to use addTarget().

Example 1:

function onBeforeMainStart() {
 $_JOB.linkcheck=true; // override default to enable link checking

Example 2:

If you're creating a CSV output file for a Batch Wizard job, then you may want to delete any old CSV files and create a new one with column headers. Actually, you don't even need deleteFile() here because writeFile() will replace the file because the append flag is not set, but we're leaving it in for purposes of the example.

function onBeforeMainStart() {