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

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