home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Script by Will Hains
-
- //
- // Skips the next character if it is a close parenthesis,
- // otherwise inserts a close parenthesis.
- //
-
- function DoCommand()
- {
- var editor = getActiveEditor();
- if(editor) {
- var range = editor.getSelection();
-
- var startLine = range.startLineIndex;
- var startChar = range.startCharIndex;
- var endLine = range.endLineIndex;
- var endChar = range.endCharIndex;
-
- if((startLine == endLine) && (startChar == endChar)) {
- if(editor.copy(endLine, endChar, endLine, endChar + 1) == ")") {
- editor.select(endLine, endChar + 1, endLine, endChar + 1);
- }
- else {
- editor.remove(range);
- editor.insert(
- startLine, startChar,
- ")"
- );
- }
- }
- else {
- editor.replace(")", range);
- }
- }
-
- editor.setActive();
-
- }
-
- !!/Script
-
-