Hello script writers!
Do you miss the Find Select method in the script environment to select a block from current caret position to end of a found string, or to select a block between two strings as you can use it in the macro environment with the command Find Select "..." ?
Yes, then look on the following two functions which I have developed to make this selection method also available in the script area.
Perl experts would say that a Perl regular expression search string can do the same and that is often right and the better choice, but not always.
If you want to report mistakes or have suggestions for further enhancements post a message here.
The script file FindSelectInnerOuter.js with the code can be viewed or downloaded from the Macros & Scripts page.
The line and block comments can be removed from functions FindSelectInner and FindSelectOuter by running a replace all (from top of file) searching with Perl regular expression for ^ *//.+[\r\n]+|^ */\*[\s\S]+?\*/[\r\n]+| +//.+$ and using an empty replace string. The first part in this OR expression with three arguments matches entire lines containing only a line comment, the second part matches block comments, and third part matches line comments right to code. Removal of the comments makes the usage of these functions in other scripts more efficient because of JavaScript interpreter has to interpret less characters and lines.
Do you miss the Find Select method in the script environment to select a block from current caret position to end of a found string, or to select a block between two strings as you can use it in the macro environment with the command Find Select "..." ?
Yes, then look on the following two functions which I have developed to make this selection method also available in the script area.
Perl experts would say that a Perl regular expression search string can do the same and that is often right and the better choice, but not always.
If you want to report mistakes or have suggestions for further enhancements post a message here.
The script file FindSelectInnerOuter.js with the code can be viewed or downloaded from the Macros & Scripts page.
The line and block comments can be removed from functions FindSelectInner and FindSelectOuter by running a replace all (from top of file) searching with Perl regular expression for ^ *//.+[\r\n]+|^ */\*[\s\S]+?\*/[\r\n]+| +//.+$ and using an empty replace string. The first part in this OR expression with three arguments matches entire lines containing only a line comment, the second part matches block comments, and third part matches line comments right to code. Removal of the comments makes the usage of these functions in other scripts more efficient because of JavaScript interpreter has to interpret less characters and lines.