Home » Products » UltraEdit/UEStudio » Getting Started

Scripting Demo and Tutorial

Scripting in UltraEdit/UEStudio is enabled through embedding of the JavaScript engine.  The scripting engine supports the core functionality of JavaScript 1.7.  Further information on JavaScript may be found on the associated Mozilla site (http://developer.mozilla.org/en/docs/JavaScript).  

 

Scripting Tutorial

For a short scripting tutorial please click here.

 

Demo Scripts

Demo scripts may be found in the UltraEdit installation directory in the scripts subdirectory (typically c:Program FilesIDM Computer SolutionsUltraEditscripts).  These and any other JavaScript scripts may be opened directly in UltraEdit for editing with integrated syntax highlighting as in the example below:

 

 

The hello.js script demonstrates the simplest form of script supported - a single line script that writes to the active file:

 

 

To invoke this script please go to Scripting in the Advanced menu and click on the Scripts... item in the submenu.  This will present the Scripting configuration dialog.  If you press the Add button and navigate to the "scripts" directory below the installation directory you may add " hello.js" to the list of scripts available to be run.  You may assign a hotkey to the script by clicking in the Hotkey field and pressing the desired keys.  Scripts that are added will be dynamically updated in the bottom of the Scripts... submenu referenced above and may be invoked through hotkeys or by clicking on the script name in this list.

 

To be fully self-contained this script actually creates a new Edit document to write to and the script may be run without opening any documents.

 

The stringvar.js script shows the ability to capture user input and store it in variables for later use in the script:

 

 

This may be invoked as described above for the hello.js script.  To run this demo, please open any text file and specify the string you wish to search for and the number of occurrences you wish to find.  The script will then open a new document and write the specified number of matching lines to the new file.

 

The header.js script demonstrates the ability to find the number of open files using the document JavaScript array object which is a property of the UltraEdit application object.  This is an array of all currently opened documents.  UltraEdit is the application object that all UltraEdit operations will be based on.  Using this information, this script iterates through all open documents writing a predefined header:

 

 

For information regarding the commands supported for scripting, please see the Scripting commands Help topic.

Attachments
There are no attachments for this article.
Related Articles
File Tree View Interface
Viewed 7166 times since Thu, Oct 13, 2011
Latest Version
Viewed 2723 times since Thu, Oct 20, 2011
Cursor Arrows (Cursor Movement)
Viewed 2857 times since Thu, Oct 13, 2011
Blocking Text / Column Mode
Viewed 3127 times since Thu, Oct 13, 2011
Resource Editor
Viewed 2962 times since Thu, Oct 13, 2011
Command Line Parameters
Viewed 16313 times since Thu, Oct 13, 2011
Code Folding
Viewed 2625 times since Thu, Oct 13, 2011
Inserting Special Characters
Viewed 3326 times since Thu, Oct 13, 2011
Drag and Drop Files
Viewed 3705 times since Thu, Oct 13, 2011
Selecting Text
Viewed 3731 times since Thu, Oct 20, 2011