Take notes on the command line is part of Short Circuit's Console Program Basics selection.
Invoking NOTES without commandline arguments displays the current contents of the local NOTES.TXT if it exists.
If NOTES has arguments, the current date and time are appended to the local NOTES.TXT followed by a newline.
Then all the arguments, joined with spaces, prepended with a tab, and appended with a trailing newline, are written to NOTES.TXT.
If NOTES.TXT doesn't already exist in the current directory then a new NOTES.TXT file should be created.

 
procedure write_out_notes (filename)
  file := open (filename, "rt") | stop ("no notes file yet")
  every write (!file)
end
 
procedure add_to_notes (filename, strs)
  file := open (filename, "at")  | # append to file if it exists
          open (filename, "cat") | # create the file if not there
          stop ("unable to open " || filename)
  writes (file, ctime(&now) || "\n\t")
  every writes (file, !strs || " ")
  write (file, "")
end
 
procedure main (args)
  notes_file := "notes.txt"
  if *args = 0 
    then write_out_notes (notes_file)
    else add_to_notes (notes_file, args)
end
 