Creating Tools

You create new tools in the Tools>>Edit Tools dialog box.

You may specify a Command without a full path. For example, you may specify a command to launch notepad by using notepad.exe instead of C:\WINDOWS\System32\notepad.exe. If the command does not have an absolute path, Lite Edit searches for the command in the following directories:

  1. The directory of LiteEdit.exe.
  2. The 32-bit Windows system directory if one exists. This is typically C:\WINDOWS\system32.
  3. The 16-bit Windows system directory. This is typically C:\WINDOWS\system.
  4. The current Windows directory.
  5. The directories in the PATH environment variable.

You may enter environment variables and any of the following macros for the Command, Paramters, and Initial directory.

Macro Definition Example (open file is C:\Folder\File.txt)
%FilePath% The full path of the currently opened file C:\Folder\File.txt
%FileDir% The directory of the currently opened file with trailing backslash C:\Folder\
%FileName% The file name of the currently opened file without extension File
%FileExt% The file extension of the currently opened file txt
%CurDir% The current windows directory N/A
%LineNum% The one based line number of the caret N/A
%ColNum% The one based horizontal position of the caret N/A
%SelText% The selected text N/A
%SelStart% The zero based index of the start of the selection, or the index of the caret if there is no selection N/A
%SelEnd% The zero based index of the end of the selection, or the index of the caret if there is no selection N/A
%Prompt:<prompt message>% Prompts you for input when the command executes and replaces this macro with the text you enter at the prompt. The prompt dialog box displays the <prompt message>. The <prompt message> may use the following escaped characters:
    \n = new line
    \t = tab
    \\ = back slash
N/A

Below the Command, Paramters, and Initial directory, Lite Edit gives you a preview of the result of the environment variable and macro substitution for the currently opened file.

When specifying Parameters, if an environment variable or macro expands to a string with spaces, you must enclose the environment variable or macro in quotes (e.g. "%FilePath%") to ensure that it gets passed as one parameter. You should not enclose the Command or Initial directory in quotes.

Sometimes you may need to do more to run an external program than you can do in the Edit Tools dialog box. For example, you want to execute DOS commands such as pause or set when the program executes. You can do this by creating a batch file that runs the program and specifying the batch file as the Command in the Edit Tools dialog box.


Filters: tools that modify the current selection

The command can modify the selected text if you enable the Command is a filter option. A filter is a program that reads text from standard input and writes text to standard output. When you enable the Command is a filter option, Lite Edit passes the selected text to the command through standard input. Then Lite Edit replaces the selected text with the text that the command writes to standard output.

Filter Examples: