home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / newurl.zip / newurl.cmd < prev    next >
OS/2 REXX Batch file  |  1996-10-27  |  1KB  |  42 lines

  1. /************************************************************/
  2. /*                                                          */
  3. /* newurl.cmd                                               */
  4. /*                                                          */
  5. /* Script that scans a mail file, and starts an URL creator */
  6. /* with the subject being the URL.                          */
  7. /*                                                          */
  8. /* Requires createurlobj.cmd for operation.                 */
  9. /*                                                          */
  10. /* Copyright (C) 1996 Bjorn Fahller                         */
  11. /*                                                          */
  12. /************************************************************/
  13.  
  14. parse arg filename
  15.  
  16. subject='';
  17. headerfound=0;
  18. status = stream(filename, 'c', 'open read')
  19. do while (headerfound == 0 | subject == '')
  20.    iline = linein(filename);
  21.    parse var iline header': 'content
  22.    if content \= "" & headerfound == 0 then
  23.      do
  24.        headerfound=1;
  25.      end
  26.    if header == "" & headerfound == 1 then
  27.      do
  28.        exit 2;
  29.      end
  30.    if header == "Subject" then
  31.      do
  32.        subject=content;
  33.      end
  34. end /* do */
  35. status = stream(filename, 'c', 'close');
  36.  
  37. parse var subject type'://'address
  38. Address cmd 'detach createurlobj 'type' 'address
  39.  
  40. exit 0;
  41.  
  42.