; write current date and time to text file #persistent sleepTime := 1000 path := "C:\Users\Johnny\Desktop\time.txt" SetTimer, WriteTime, %sleepTime% WriteTime: content := "" FormatTime, content, , yyyy-MM-dd hh:mm:ss file := FileOpen(path, "w") file.Write(content) file.Close() ; MsgBox, %content% return