home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 2000 - Modelworks Software
-
- /**
- @Tool: findMatchingParen~find the matching closing paren.
- @EndTool:
- @Summary: findMatchingParen~find the matching closing paren
- */
-
- function DoCommand()
- {
- var editor = getActiveEditor();
- if (editor)
- {
- var selection = editor.getSelection();
- var delimiter = editor.copy(selection);
- if (delimiter == '(')
- {
- var list = editor.findNextDelimiters('(', ')',
- selection.startLineIndex, selection.startCharIndex);
-
- if (list)
- {
- var range = list.removeHead();
- editor.select(range);
- }
- }
- else
- {
- alert("To use findMatchingParen first select the opening paren");
- }
- }
- }
-
- !!/Script
-
-