home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / comm / fido / spot / rexx / uuxt.spot < prev    next >
Text File  |  1994-05-02  |  2KB  |  81 lines

  1. /* UUxT4Spot v1.0 */
  2. /* 1-5-1994 */
  3. /* © 1994 Daniel Smith */
  4.  
  5. /* This is a front-end for use with Spot and the excellent UUcoder util, */
  6. /* UUxT. If you haven't got this uudecoder, this script won't be any use */
  7. /* to you. I recommend you try UUxt though. It's the best uucoder I've seen */
  8.  
  9. /* Thanks go to Asher Feldman for UUxT and Nico Francois for Spot */
  10.  
  11. /* Contact me with comments, suggestions, bugreports etc... */
  12. /* Internet: daniel.smith@portofc.org */
  13. /* Fidonet : 2:254/149.5              */
  14.  
  15. address 'SPOT'
  16. options results
  17.  
  18. /* You will probably need to change the paths below */
  19. path='DH0:Uploads' /* The default dir for the encode filerequester */
  20. decodedpath='RAM:' /* The default dir for the decode pathrequester */
  21. file='T:Spot.temp' /* The Spot edit file - find under Settings,    */
  22.                    /* General in Spot */
  23.  
  24. /* Don't change anything else */
  25. title='UUxT4Spot v1.0 © 1994 Daniel Smith'
  26. prompt='Please select the UU option required:'
  27.  
  28. 'isarealist'
  29. if rc=0 then call warn()
  30.  
  31. 'requestresponse TITLE "'title'" PROMPT "'prompt'" GADGETS "_Decode|_Encode|_Cancel"'
  32. IF RC=0 then exit
  33. code=RC
  34.  
  35. IF code=2 then do
  36. /* Encode */
  37. 'requestfile TITLE "Choose file to uuencode:" PATH "'path'"'
  38. IF RC~=0 then exit
  39. uufile=result
  40. lha=1
  41. if right(uufile,4)~='.lha' then call asklha()
  42. address command
  43. IF lha=1 then 'UUxT a "'file'" "'uufile'"'
  44. address 'SPOT'
  45. IF lha=2 then do
  46.     lha='.lha'
  47.     'requeststring TITLE "Enter .lha filename"'
  48.     lhafile=result
  49.     address command
  50.     'UUxt l "'file'" "'lhafile'" "'uufile'"'
  51. end
  52. address 'SPOT'
  53. 'write FILE "'file'"'
  54.  
  55. exit
  56. end
  57.  
  58. IF code=1 then do
  59. /* Decode */
  60. 'saveascii TO "'file'" OVERWRITE NOHEADER NOTEARLINE NOORIGIN NOKLUDGES NOREFLOW'
  61. 'requestpath TITLE "Select directory" PATH "'decodedpath'"'
  62. decodedpath=result
  63. oldcd=pragma('d',decodedpath)
  64. address command
  65. 'UUxt x "'file'"'
  66. call pragma('d',oldcd)
  67. end
  68.  
  69. exit
  70.  
  71. asklha:
  72. 'requestresponse TITLE "'title'" PROMPT "Do you wish to use LhA?" GADGETS "_No|_Yes|_Cancel"'
  73. IF RC=0 then exit
  74. lha=RC
  75. return
  76.  
  77. warn:
  78. 'requestnotify PROMPT "Use only from message window or list!"'
  79. exit
  80.  
  81.