Copy link to clipboard
Copied
If the file does not exist, create the file.
If the file exists, add a new line at the end.
function writeLog(text) {
var logFile = File("C:\\Users\\USUARIO\\Documents\\logFile.log");
logFile.open("a+", "TEXT", "????");
var time = new Date();
logFile.write(time.toString() + " | " + text+"\r");
logFile.close();
}
writeLog("frist");
writeLog("second");
Have something to add?