code: private void startScript(String line, DispatchCallback callback) {
      OutputFile outFile = sqlLine.getScriptOutputFile();
      if (outFile != null) {
        callback.setToFailure();
        sqlLine.error(sqlLine.loc("script-already-running", outFile));
        return;
      }
  
      String filename;
      if (line.length() == "script".length()
          || (filename =
              sqlLine.dequote(line.substring("script".length() + 1))) == null) {
        sqlLine.error("Usage: script <file name>");
        callback.setToFailure();
        return;
      }
  
      try {
        outFile = new OutputFile(expand(filename));
        sqlLine.setScriptOutputFile(outFile);
        sqlLine.output(sqlLine.loc("script-started", outFile));
        callback.setToSuccess();
      } catch (Exception e) {
        callback.setToFailure();
        sqlLine.error(e);
      }
    }
docs: Start writing to the specified script file.