home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Misc / trimTrailingSpaces.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  624 b   |  31 lines

  1. !!Script
  2. // Copyright ⌐ 2000 - Modelworks Software
  3. // @Created build 346 cm20000410
  4.  
  5. /**
  6. @Tool: trimTrailingSpaces~removes trailing spaces from the end of lines in the 
  7. active editor. 
  8. @EndTool: 
  9. @Summary: trimTrailingSpaces~removes trailing spaces
  10. */
  11.  
  12.  
  13. function DoCommand()
  14. {
  15.     var editor = getActiveEditor();
  16.     if (editor)
  17.     {
  18.         var findData = editor.findFirst("[ \t]+$", 0, 0, true, true, true);
  19.         while (findData && findData.found)
  20.         {
  21.             var range = findData.range;
  22.             editor.replace("", range);
  23.             editor.findNext(findData);
  24.         }
  25.         editor.setActive("Remove tailing spaces");
  26.     }
  27. }
  28.  
  29. !!/Script
  30.  
  31.