// This is a command line macro that counts 
// the number of lines in a text file.
  path = getArgument();
  if (path!="")
      run("Open...", "open="+path);
  else
      run("Open...");
  if (nImages>0)
      exit("\"" + path + "\" is not a text file");
  text = getInfo();
  lines = split(text, "\n");
  print("Line count: "+0+lines.length);

