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

  1. !!Script 
  2. // Copyright ⌐ 1999 - Modelworks Software
  3. // @Modified build 497 cm20010225
  4.  
  5. /**
  6. @Tool: mark~sets a bookmark for the line containing the 
  7. current selection in the active editor. The bookmark
  8. @EndTool: 
  9. @Summary: mark~sets a bookmark for the current line
  10. */
  11.  
  12. function DoCommand()
  13.     var bookmarkMap = getMapFile("Bookmarks");
  14.     
  15.     var editor = getActiveEditor();
  16.     if (editor)
  17.     {
  18.         var selection = editor.getSelection();
  19.         var bookmark = editor.newBookmark(selection.startLineIndex);
  20.         
  21.         if (bookmark)
  22.         {
  23.             setGlobal(" $current mark", bookmark);
  24.             bookmarkMap.add(bookmark.hashKey, bookmark);
  25.         }
  26.     }
  27. }
  28.  
  29. !!/Script
  30.