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

  1. !!Script
  2. // Copyright ⌐ 1998 - Modelworks Software
  3. // @Modified buile 304 cm19990621 - removed JDK initilization
  4.  
  5. // This script lets you set your application
  6. // paths
  7.  
  8. var gOutput = getOutput();
  9. var gHelpers = getMapFile("HelpPaths.map");
  10.  
  11.  
  12. function EditDirectory(path)
  13. {
  14.     var directory = chooseDirectory("Locate your help folder", path, "");
  15.     if (directory)
  16.     {
  17.         return directory;
  18.     }
  19.     return null;
  20. }
  21.  
  22. function InitHelpPaths()
  23. {
  24.     if (gHelpers.define("IDE Script Reference", File.getDocumentsPath() + "\\Ide\\Script Reference"))
  25.     {
  26.         gOutput.writeLine("Setting IDE Script Reference help path to " + gHelpers.lookup("IDE Script Reference", ""));
  27.     }
  28.  
  29.     if (gHelpers.define("IDE Tools Reference",File.getDocumentsPath() + "\\Ide\\Tools Reference"))
  30.     {
  31.         gOutput.writeLine("Setting IDE Tools Reference help path to " + gHelpers.lookup("IDE Tools Reference", ""));
  32.     }
  33.  
  34.     if (gHelpers.define("IDE FAQ", File.getDocumentsPath() + "\\Ide\\FAQ"))
  35.     {
  36.         gOutput.writeLine("Setting IDE FAQ help path to " + gHelpers.lookup("IDE FAQ", ""));
  37.     }
  38.  
  39.     //if (gHelpers.define("IDE Notes", File.getToolsPath()))
  40.     //{
  41.     //    gOutput.writeLine("Setting IDE Notes help path to " + gHelpers.lookup("IDE Notes", ""));
  42.     //}
  43. }
  44.  
  45. function DoCommand()
  46. {        
  47.     var propertyLabelList = newList();
  48.     var propertyList = newList();
  49.     var valueList = newList();
  50.     var actionList = newList();
  51.     
  52.     var position = gHelpers.getHeadPosition();
  53.     while (position && position.valid)
  54.     {
  55.         var item = gHelpers.getNext(position);
  56.         propertyLabelList.addTail(item.key);
  57.         propertyList.addTail(item.key); 
  58.         valueList.addTail("" + item.value);
  59.         actionList.addTail(EditDirectory);
  60.     }
  61.     
  62.     var results = editProperties("Help Paths", "Edit Help Paths",
  63.     "Location", "Help Path or URL", propertyLabelList, valueList, actionList);
  64.     
  65.     if (results)
  66.     {
  67.         var propertyPostion = propertyList.getHeadPosition();
  68.         var valuePosition = valueList.getHeadPosition();
  69.         while (propertyPostion.valid && valuePosition.valid)
  70.         {
  71.             var property = propertyList.getNext(propertyPostion);
  72.             var value = valueList.getNext(valuePosition);
  73.             
  74.             // Update the value of the property
  75.             gHelpers.setValue(property, value); 
  76.         }
  77.     }
  78. }
  79.  
  80. !!/Script
  81.