home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Misc / insertFilePath.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  762 b   |  27 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insertFilePath~displays a standard open file dialog to let you select a 
  6. file to insert as a quoted full file path at the current selection. 
  7. Note: a quoted file path uses '\\' as the directory separator. 
  8. @See: openFilePath@Tools Reference/Tools/Misc.html#openFilePath 
  9. @EndTool: 
  10. @Summary: insertFilePath~inserts a quoted full file path 
  11. */
  12.  
  13. function DoCommand()
  14. {
  15.   var file = chooseFile("Choose a File path to insert", "All Files", "*.*")
  16.   
  17.   var editor = getActiveEditor();
  18.   if (file && editor)
  19.   {
  20.     var selection = editor.getSelection();
  21.     editor.replace(file.getQuotedPath(), selection);
  22.     editor.setActive("Insert Quoted File Path");
  23.   }
  24. }
  25.  
  26. !!/Script
  27.