Site logo

Report

Example of the final report at the end of a script

var startTime = new Date();
var count = 0;
// do something
var endTime = new Date();
var duration = GetDuration(startTime, endTime);
var report = count + " hyperlink" + ((count == 1) ? " was" : "s were") + " created.\n(time elapsed: " + duration + ")";

if (errorsArr.length > 0) {
	var errorsTxt = "\n\n" + errorsArr.length + " error" + ((errorsArr.length == 1) ? "" : "s") + " occured. See the log for details.";
	report += errorsTxt;
}

alert(report, scriptName);