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

  1. !!script 
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: addPackage~displays a dialog to allow you to define a package source directory 
  6. to add to the Browser. You can use addPackage to add a directory with any files types 
  7. to the Browser by choosing the Custom package type in the dialog. 
  8. @Image: Add Package Dialog@addPackage_ChoosePackage.gif 
  9. @Paragraph: If you choose the custom type, you will also be asked by another dialog 
  10. to define the source and destination file types for a custom package type. The 
  11. format expected by the Custom file type dialog is 
  12. <code>".<source extension type 1>.<destinatin extension type>"</code>. 
  13. For example, to define a text file type you can define the source and destination 
  14. files as <code>".txt.txt"</code>. 
  15. @Image: Define Types Dialog@addPackage_DefineTypes.gif 
  16. @See: Project@Script Reference\Objects\Project.html
  17. @Summary: addPackage~adds a Package object to the Browser 
  18. @EndTool: 
  19. */
  20.  
  21. var output = getOutput();
  22.  
  23. function DoCommand()
  24. {
  25.   output.clear();
  26.   
  27.   var new_package = 
  28.     chooseNewPackage("Choose Package to add to Browser"); 
  29.   // Note you can not use the variable name "package"
  30.   // because it is a reserve word in JavaScript
  31.  
  32.   if (new_package)
  33.   {
  34.     Browser.addPackage(new_package);
  35.   }
  36. }
  37.  
  38. !!/script
  39.  
  40.