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

  1. !!Script
  2. // Copyright ⌐ 1998 - Modelworks Software
  3. // @Created build 228 cm19981017
  4.  
  5. // This script lets you set your application
  6. // paths
  7.  
  8. var gOutput = getOutput();
  9. var gHelpers = getMapFile("ApplicationHelpers");
  10.  
  11.  
  12. function EditExe(path)
  13. {
  14.     var file = chooseFile("Locate your application", "*.exe", "*.exe", path, "choose application");
  15.     if (file)
  16.     {
  17.         return file.path;
  18.     }
  19. }
  20.  
  21. function InitApplications()
  22. {
  23. }
  24.  
  25. function DoCommand()
  26. {    
  27.     var propertyLabelList = newList();
  28.     var propertyList = newList();
  29.     var valueList = newList();
  30.     var actionList = newList();
  31.     
  32.     var propertyName = "DefaultHtmlBrowser";
  33.     var propertyValue = gHelpers.lookup(propertyName);
  34.     propertyLabelList.addTail("Default Html Browser");
  35.     propertyList.addTail(propertyName); 
  36.     if (propertyValue && propertyValue.exists)
  37.     {
  38.         valueList.addTail("" + propertyValue.path);
  39.     }
  40.     else
  41.     {
  42.         valueList.addTail("");
  43.     }
  44.     actionList.addTail(EditExe);
  45.     
  46.     var results = editProperties("Applications", "Edit Applications",
  47.     "Location", "Application Path", propertyLabelList, valueList, actionList);
  48.     
  49.     if (results)
  50.     {
  51.         var propertyPostion = propertyList.getHeadPosition();
  52.         var valuePosition = valueList.getHeadPosition();
  53.         while (propertyPostion.valid && valuePosition.valid)
  54.         {
  55.             var property = propertyList.getNext(propertyPostion);
  56.             var value = valueList.getNext(valuePosition);
  57.             
  58.             // Update the value of the property
  59.             gHelpers.setValue(property, newFile(value)); 
  60.         }
  61.     }
  62. }
  63.  
  64. !!/Script
  65.