RosettaCodeData/Task/Take-notes-on-the-command-line/AutoHotkey/take-notes-on-the-command-line.ahk
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

23 lines
507 B
AutoHotkey

Notes := "Notes.txt"
If 0 = 0 ; no arguments
{
If FileExist(Notes) {
FileRead, Content, %Notes%
MsgBox, %Content%
} Else
MsgBox, %Notes% does not exist
Goto, EOF
}
; date and time, colon, newline (CRLF), tab
Date := A_DD "/" A_MM "/" A_YYYY
Time := A_Hour ":" A_Min ":" A_Sec "." A_MSec
FileAppend, %Date% %Time%:`r`n%A_Tab%, %Notes%
; command line parameters, trailing newline (CRLF)
Loop, %0%
FileAppend, % %A_Index% " ", %Notes%
FileAppend, `r`n, %Notes%
EOF: