home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / lang / mpw_scri.hqx / ExCon.pit / expand < prev    next >
Encoding:
Text File  |  1987-02-15  |  1.4 KB  |  57 lines

  1. # Expand option characters in a file to their 'English' equivalent.
  2. #
  3. # Use before sending an MPW file as a text file to keep your 7 bit
  4. #   line / comm service from choking.
  5. #
  6. # Reverse the process with Contract
  7. #
  8. # Steve Knouse
  9. # Apple Computer
  10. # 2950 N Loop W, Suite 1070
  11. # Houston, TX  77092
  12. # Applelink: KNOUSE
  13.  
  14. # check the syntax
  15. if {#} <> 1 
  16.     echo Error: useage {0} filename
  17.     exit
  18. end
  19.  
  20. # set the target file
  21. target {1}
  22.  
  23. # make sure we don't exit if some of the chars are missing
  24. set exit 0
  25.  
  26. # replace the special chars
  27. find Ñ ; replace -c ░ /'¬'/ 'OpTiOn-2'
  28. find Ñ ; replace -c ░ /'¡'/ 'OpTiOn-='
  29. find Ñ ; replace -c ░ /'│'/ 'OpTiOn-.'
  30. find Ñ ; replace -c ░ /'▓'/ 'OpTiOn-,'
  31. find Ñ ; replace -c ░ /'╓'/ 'OpTiOn-/'
  32. find Ñ ; replace -c ░ /'╔'/ 'OpTiOn-;'
  33. find Ñ ; replace -c ░ /'┴'/ 'OpTiOn-1'
  34. find Ñ ; replace -c ░ /'░'/ 'OpTiOn-5'
  35. find Ñ ; replace -c ░ /'ñ'/ 'OpTiOn-6'
  36. find Ñ ; replace -c ░ /'Ñ'/ 'OpTiOn-8'
  37. find Ñ ; replace -c ░ /╢╢/ 'OpTiOn-d'
  38. find Ñ ; replace -c ░ /'─'/ 'OpTiOn-f'
  39. find Ñ ; replace -c ░ /'⌐'/ 'OpTiOn-g'
  40. find Ñ ; replace -c ░ /'╞'/ 'OpTiOn-j'
  41. find Ñ ; replace -c ░ /'┬'/ 'OpTiOn-l (lowercase L)'
  42. find Ñ ; replace -c ░ /'┼'/ 'OpTiOn-x'
  43. find Ñ ; replace -c ░ /'╟'/ 'OpTiOn-\'
  44. find Ñ ; replace -c ░ /'╚'/ 'OpTiOn-Shift-\'
  45. # special handling for the tag operator
  46. find Ñ
  47.     loop
  48.         find /¿/ || break
  49.         replace ñ 'OpTiOn-r'
  50.     end
  51.     
  52. # go to the top of the file
  53. find Ñ
  54.  
  55. set exit 1
  56.  
  57.