core.debug(text) writes text into the Output (or Log?) tab of the script console.
// vim: ft=javascript
//
// ..\..\runScript.bat debug.ssc
//
// Press F12 to see debug output.
// (Unfortunately, this output does not seem to
// be generated if the script is run from the
// command line)
core.debug("here's some text");