User-Submitted Macros and Scripts
If you have any macros or scripts you would like to share with other users, please email them to firstname.lastname@example.org.
- Writing a powerful macro
- Running macros/scripts from the command line
- Using the ^c (copied text) and ^s (selected text) variables for dynamic macros
- Macros for smart sorting *.ini and *.reg and similar files by Mofi - 2013-07-09
- Macro for reverse ordering of all or just selected lines by Mofi - 2009-12-29
- Syntax highlighting/wordfile sorting macro validation tools by Mofi - 2013-01-06 This package also contains macros for managing wordfiles and their color settings.
- Many useful miscellaneous macros by Jesse Heines - 2010-11-22
- User clipboard macros by H.-J. Täubrich - 2007-05-10
- Miscellaneous macros for HTML editing by Dale Richmond - 2010-11-22
- C Indent Macro by Oliver Tscherwitschke - 2000-12-01
- HTML Strip Macros by Gabe Anguiano - 1999-08-24
- HTML Macros by D. Richmond - 2000-06-19
- HTML Macros by S. Bellone - 1997-06-12
- Misc Macros by R. Dotson - 1997-06-12
- Misc Macros by John Goodman - 1998-10-26
- Spanish Macro by David Dodds - 2001-01-15
- Misc Macros by Willem van der Nat - 2004-10-14
- Reformatting Macros for EDI/X12 Analysts by John Turpin - 2007-04-30
- Introduction to scripting
- Scripting Access to the Output Window (debugging)
- Common scripting techniques
- Search and delete lines found with scripting
Starter scripts for learning
- String var Demonstrates how to programmatically use a user-provided string
- 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.
- 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
- 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 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.
- 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.
- 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.
- 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.
- Join lines Automatically joins/combines selected lines
- JSON Reformat Reformats a file with JSON content to make it readable
- Line randomizer Converts selected text into an array split at each line terminator, then randomizes the array and writes out each line randomly
- 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
- 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)
- 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).