home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / opus / v5 / arcsearch / arcsearch.dopus5 next >
Text File  |  1996-09-20  |  2KB  |  77 lines

  1. /*
  2.   $VER: ArcSearch V1.0 (20/09/96)
  3.  
  4.   Rob Saxby robs@telecall.co.uk - http://www.telecall.co.uk/~robs - #IRC ChromeB
  5.  
  6.   Searches through LHA / LZH / LZX archives to extract files
  7.  
  8.   Setup Command - [Arexx] Dopus5:arexx/arcsearch.dopus5 {Qp}
  9.  
  10.   You can use the "|" (or) command in the string aswell, Eg "font|device|library"
  11.  
  12.   Feel free to enhance this script! Send to me if you do, cheers...
  13. */
  14.  
  15. parse arg portname .
  16.  
  17. Options results
  18.  
  19.  If portname='' then
  20.    portname='DOPUS.1'
  21. address value portname
  22.  
  23. lister query source
  24.  If rc>0 then do
  25.      dopus request '"Please select a source file!" ok'
  26.   Call Quit
  27.  End
  28.  
  29. Outpath = 'T: ' /*Define your own output path*/
  30.  
  31. parse var result handle .  
  32.  
  33. lister set handle busy on
  34.  
  35. lister query handle path
  36.  FullPath = RESULT
  37.  
  38. dopus getstring '"Enter search string" 255"" Ok'
  39.  Find = RESULT
  40.  
  41. lister query handle selfiles stem files.
  42.  
  43. lister set handle progress files.count 'Searching...'
  44. lister set handle title 'Searching...'
  45. lister refresh handle full  
  46.  
  47. do i=0 to files.count-1
  48.    lister query handle abort
  49.     if RESULT then
  50.       signal Quit
  51.  
  52.    lister set handle progress count i+1
  53.    lister set handle progress name files.i
  54.    lister query handle entry files.i stem fileinfo.
  55.  
  56.    SetFile ='"'FullPath||fileinfo.name'"'
  57.    ext=reverse(fileinfo.name)
  58.    parse var ext ext '.'
  59.    ext=upper(reverse(ext))
  60.  
  61.     if ext='LHA' | ext='LZH' then
  62.       address command 'lha >NIL: x' SetFile Outpath'#?('find')#?'
  63.  
  64.     if ext='LZX' then
  65.       address command 'lzx >NIL: x' SetFile Outpath'#?('find')#?'
  66.  
  67.    lister select handle '"'fileinfo.name'"' off
  68. End
  69.  
  70. Signal Quit
  71.  
  72. Quit:
  73.      lister set handle title
  74.      lister refresh handle full
  75.      lister set handle busy off
  76.   
  77.