UltraEdit macros and scripts

If you have any macros or scripts you would like to share with other users, please email them to [email protected].

Starter scripts for learning

  • Hello world
    A basic JavaScript to introduce you to scripting support in UltraEdit/UEStudio.
  • String var
    Demonstrates how to programmatically use a user-provided string

Download Scripts

  • ANSI/Unicode string to Perl regexp string
    Script to convert a selected ANSI or Unicode string to a Perl regular expression string in clipboard by replacing all characters with code value greater than 127 by their hexadecimal representations.
  • Backup single (active) file
    Creates a time-stamped backup file of the active file in the same directory
  • Backup/copy active file and open in new window
    Copies the active document to a new window and saves it as a new version of the original file with a quasi-versioning system (Note: requires FileNameFunctions script)
  • Columnizer
    Takes a multi-row selection and inserts spaces between the words, as necessary, to form columns.
  • Convert ASCII-represented hex to hex
    Takes a user selection of ASCII-represented hex data and converts it to actual hex data. For example, pasting “68 65 6C 6C 6F” into a new text file and running the script on it will convert it to “hello”.
  • Convert all open files to DOS line terminators
    Converts all open files to DOS format (0D 0A line terminators)
  • Convert box-bracket function parameters to comments
    Changes open and close box brackets in function parameters in selected text with open and close comments
  • Convert files to UTF-8
    Converts all files in a folder or folder tree, or all open files, or all project files to UTF-8 while also updating the character set or encoding declaration of HTML, XHTML and XML files.
  • Convert selection to VBA string
    Converts any selection to a VBA compatible string, escaping any existing strings in the text. The string is assigned a generic variable name. Multiple lines are supported via “&”.
  • Copy file content
    Copies entire content of active file to active clipboard without changing the caret (cursor) position in the file
  • Count selected lines
    When invoked, returns a prompt of how many lines are currently selected
  • Count selected lines v2
    An updated selected line counter with automatic support for DOS, Unix, and Mac line terminators
  • CSV transposer
    Takes a csv file and transposes the data horizontally
  • Delete lines containing string
    Deletes lines containing user-specified string, then reports on what was deleted
  • Extract inner text from XML node
    Extracts the InnerText from the selected XML node. Only a whole node is supported.
  • File name functions
    Contains functions to get the file extension, or the file name with or without extension, or the file path from an opened document or a file name string
  • Filter lines
    Filters lines from file containing a specified string (like List lines containing string)
  • Find duplicate lines
    Finds and reports duplicate lines in file without requiring sort or altering file data
  • Find files containing one string but not another
    Find all files within a folder that contain one (user-specified) string, but not another (user-specified) string.
  • Find string with selecting block
    2 functions for selecting a block between 2 found strings or a found string and the cursor position
  • Find strings to new file
    Scripts to find strings with a regular expression and output the found strings to a new file line by line.
  • Fixed column to CSV
    Script with function to convert a fixed column file to a CSV file with separator and field widths entered by the user.
  • Find Unicode text in hex edit mode
    Find Unicode text encoded in UTF-16 LE in binary file opened in hex edit mode.
  • Get a list of files
    Function to get a file list into edit window based on various parameters for running a script on all files in the list
  • Get line terminator
    Function that will detect the line terminator of the active document, then store it in a variable “terminator” that may be accessed globally and used for other operations.
  • Get string from registry value with hexadecimal values
    Converts a Windows registry value of type REG_EXPAND_SZ or REG_MULTI_SZ with hexadecimal values from a *.reg file to a readable string to output window, a new file, or active clipboard.
  • Getter/setter method generator
    Generates getter/setter methods (as typical in Java code)
  • Header
    Creates a header for all open documents
  • Hex Copy
    A function with examples for usage to get an ASCII string with hexadecimal values from text or binary data. It offers lots of parameters to determine input source, output destination and format of the output.
  • Hide lines not containing string
    Hide all lines not containing a certain search string via hide/show lines.
  • Insert/Fill Columns with string from clipboard
    Inserts or fills columns with string from active clipboard (extends Insert/Fill Columns command).
  • Insert strings in selected columns from clipboard
    Inserts strings in selected columns from active clipboard with trimming trailing spaces/tabs on end of each string.
  • Insert time (local military)
    Inserts local military time at current caret position.
  • Insert time (Zulu)
    Inserts current Zulu time at current caret position.
  • Insert today’s date
    Inserts today’s date at current caret position.
  • Insert tomorrow’s date
    Inserts tomorrow’s date at current caret position.
  • Is Unicode file
    Function which detects if just opened text file is loaded as Unicode file or as an ASCII/ANSI file
  • Javadoc comment block for a function
    Creates a Javadoc comment block for a function signature with the function’s parameters and return type parsed and included.
  • Javascript Deminifier / Reformatter
    Deminifies and reformats selected Javascript, or entire file if nothing selected
  • Join lines
    Automatically joins/combines selected lines
  • JSON Reformat
    Parses entire file (or selection, if it exists) and reformats JSON data to make it more human readable
  • Line randomizer
    Converts selected text into an array split at each line terminator, then randomizes the array and writes out each line randomly
  • Lorem ipsum generator
    Generates lorem ipsum placeholder text with options for paragraphs/words
  • Merge CSV files
    Script to merge / combine / copy the data of all files with extension CSV in a specified folder into a new file with special CSV related options
  • Merge text files
    Script to merge / combine / copy the content of all specified files in a specified folder or all open files into a new file
  • Remove Successive Lines With Duplicates
    Checks one line at a time. If the line contains a match of the specified regular expression, then the next line is checked as well. If both lines contain a match, and the matches are exactly the same, the second line is considered a duplicate and deleted from the file.
  • Reverse lines
    Takes a selection of lines and reverses the order
  • Reverse selected text
    Reverses selected text (can span one or multiple lines)
  • Snippets
    Emulates “snippets” via scripting engine when coding HTML
  • Sort Lines Based on Length
    Sorts entire file based on length of lines (Not for use on very large files)
  • Sort Strings
    Takes a set of selected strings and sorts them alphanumerically (assumes that the strings are separated by commas)
  • Split Large File by Line Number
    Splits a large file into smaller files based upon number of lines
  • XML title save
    Finds the <title> value in an XML document, then saves the file as the title.xml in a user-specified directory
  • Zap Gremlins (remove non-printable characters)
    Removes non printable characters (known as “gremlins”) from file. If a selection exists prior to the script being played, then it will remove non-printable characters from the selection (no reporting).