home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1996 January / amigagames-cdrom-1996-01.iso / rexx / execute.filer < prev    next >
Text File  |  1995-06-12  |  937b  |  50 lines

  1. /* 
  2.  
  3.    $VER: Execute.filer 1.3 (12.6.95)
  4.  
  5.    Author:
  6.     Matthias Scheler <tron@lyssa.owl.de>
  7.  
  8.    Function:
  9.     Opens a string requester, asks for a command and its args and then
  10.     executes the comand in the directory of the current directory listview.
  11.  
  12.     It's Filer's equivalent for the Workbench's "Execute" menu item.
  13.  
  14.    History:
  15.     1.2   removed unnecessary ADDRESS 'FilerRexx'
  16.     1.3   added "CALL" before "SETCLIP" to prevent search for "1.rexx"
  17.  
  18.    Call from Filer:
  19.     EXECUTE
  20.  
  21.    Example for "Filer.RC":
  22.     BUTTON ...,...,"Execute","EXECUTE"
  23.  
  24. */
  25.  
  26. OPTIONS RESULTS
  27.  
  28. 'STATUS Execute command'
  29. PANEL OFF
  30.  
  31. Command=GETCLIP('FILER_COMMAND')
  32. 'SETSTRING' Command
  33.  
  34. GETSTRING 'Enter command and args:'
  35. IF RESULT="RESULT" THEN
  36.  DO
  37.   PANEL ON
  38.   'STATUS Execution aborted'
  39.   EXIT 5
  40.  END
  41.  
  42. Command=RESULT
  43. CALL SETCLIP('FILER_COMMAND',Command)
  44.  
  45. 'EXECANDWAIT' Command
  46. UPDATESOURCEDIR
  47.  
  48. PANEL ON
  49. 'HISTORY Command "'||Command||'" executed.'
  50.