home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Application / editOpenIn.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  1.3 KB  |  54 lines

  1. !!Script
  2. // Copyright ⌐ 1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: editOpenIn~displays a choose list of the directories
  6. in the Open In list. Uncheck the items to remove directories
  7. from the Open In list.
  8. @EndTool: 
  9. @Summary: editOpenIn~let you remove files from the Open In list
  10. */
  11.  
  12. var gRecentFilesMap = getMapFile("RecentFiles");
  13. var gOutput = getOutput();
  14.  
  15. function DoCommand(commandID, menuIndex)
  16. {
  17.     var directoryList = gRecentFilesMap.lookup("OpenInList", null);
  18.     if (directoryList)
  19.     {
  20.         var selectedList = newList();
  21.         var position = directoryList.getHeadPosition();
  22.         while (position && position.valid)
  23.         {
  24.             var path = directoryList.getNext(position);
  25.             selectedList.addTail(true);
  26.         }
  27.         
  28.         var resultList = chooseOptions("Open In List",
  29.         "Edit Open In List", directoryList, selectedList);
  30.         
  31.         if (resultList)
  32.         {
  33.             var directoryPosition = directoryList.getHeadPosition();
  34.             var resultPosition = resultList.getHeadPosition();
  35.             while (directoryPosition.valid && resultPosition.valid)
  36.             {
  37.                 var currentPosition = directoryPosition.clone();
  38.                 var path = directoryList.getNext(directoryPosition);
  39.                 var keep = resultList.getNext(resultPosition);
  40.                 if (!keep)
  41.                 {
  42.                     directoryList.removeAt(currentPosition);
  43.                 }
  44.             }
  45.             gRecentFilesMap.forceUpdate();
  46.         }
  47.     }
  48. }
  49.  
  50.  
  51. !!/Script
  52.  
  53.  
  54.