📜 ⬆️ ⬇️

Scripts in UltraEdit32 v.14


There are programmers who use tools like UltraEdit32 .
In no case do not advertise this product, just decided to share information about some of its features.
This article describes the possibilities for writing scripts for UltraEdit v.14.


To automate routine tasks, UltraEdit has two tools:

So, first a few general provisions, and then a few examples that I constantly use myself.

Scripting



Creating scripts is very simple, in the “ Scripting ” menu there is a tab “ Scripts ... ” with which you can easily and simply manage all the available scripts. Also, when you select “ Script list ”, a window with a list of scripts becomes available, which can be attached in a convenient place, for example, as in the second figure, in the lower left corner.

')
More details on the script management tools can be found on the website , but not in Russian.

Scripts are stored in regular .js files and are connected automatically when the program starts.
It should be understood that scripts are not sets of functions, and when you call, everyone works from beginning to end.

To use the specific properties of the document, another one has been added to the standard JavaScript objects: UltraEdit , which is the main interface to the current workspace.

The main useful properties and methods of the UltraEdit object



We considered the most interesting properties and methods.
A full description of all the methods is in the help of the program, as well as on the site you can find some good examples of scripts.

And now a few simple scripts that I prefer to always keep on hand


Replace all double quotes in selected text with single quotes:
UltraEdit.activeDocument.mode = 1; // ,
UltraEdit.activeDocument.findReplace.selectText = true ;
UltraEdit.activeDocument.findReplace.replaceAll = true ;
UltraEdit.activeDocument.findReplace.replace( "\"" , "'" );



Commenting selected text:
UltraEdit.activeDocument.cut();
UltraEdit.activeDocument.write( "/*" );
UltraEdit.activeDocument.paste();
UltraEdit.activeDocument.write( "*/" );


I did it through the clipboard, because it's easier, but you need to remember that it overwrites the current buffer.

As an antonym to the previous script, uncommenting the selected text:
UltraEdit.activeDocument.mode = 1; // ,
UltraEdit.activeDocument.findReplace.selectText = true ;
UltraEdit.activeDocument.findReplace.replaceAll = true ;
UltraEdit.activeDocument.findReplace.replace( "/*" , "" );
UltraEdit.activeDocument.findReplace.replace( "*/" , "" );


* Source code was highlighted with Source Code Highlighter .



There are certainly more opportunities, but I use these scripts most often.

Pavel Osipov
06/17/2009.

Source: https://habr.com/ru/post/62392/


All Articles