home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 3 / chip_20018103_hu.iso / amiga / chiputil / rmicon.lha / RmIcon / rexx / RmIconE.rexx next >
OS/2 REXX Batch file  |  2001-06-12  |  889b  |  49 lines

  1. /*
  2. **   $VER: RmIcon 0.2 (12.06.2001)
  3. **
  4. **   This program the active window's selected icons
  5. **   WITHOUT ANY REQUESTER
  6. */
  7.  
  8. OPTIONS RESULTS
  9.  
  10. /* Looking for the WB's active window. */
  11.  
  12. ADDRESS WORKBENCH
  13. GETATTR WINDOWS.ACTIVE VAR path
  14.  
  15. /* If the active window is the WB window, quit. */
  16.  
  17. IF path="root" THEN EXIT
  18.  
  19. /* Counting the selected icons. */
  20.  
  21. OPTIONS FAILAT 20
  22. GETATTR WINDOW.ICONS.SELECTED.COUNT NAME '"'||path||'"' VAR n
  23.  
  24. /* If there isn't any icon, quit. */
  25.  
  26. IF RC>=10 THEN EXIT
  27.  
  28. /* Taking the selected icons' names. */
  29.  
  30. ADDRESS WORKBENCH
  31. OPTIONS FAILAT 10
  32. GETATTR WINDOW.ICONS.SELECTED NAME '"'||path||'"' STEM ICONS
  33.  
  34. /* These commands delete the selected icons. */
  35.  
  36. DO i=1 TO n
  37.    j=i-1
  38.    file=icons.j.name
  39.    file=path||file||".info"
  40.    ADDRESS COMMAND
  41.    'DELETE >NIL: "'file'"'
  42. END
  43.  
  44. /* Updating active window. */
  45.  
  46. ADDRESS WORKBENCH
  47. MENU WINDOW ACTIVE INVOKE WINDOW.UPDATE
  48.  
  49.