Vous êtes sur la page 1sur 78

Keyboard Shortcuts

Shortcut keys: Maximize your efficiency


One of UltraEdit's most powerful features is it's ease of navigation. Many users are unaware of the shortcuts available which add
speed/efficiency to this powerful application. Use these shortcuts in your day to day use of UltraEdit and see how much easier your
favorite text editor has made some simple tasks.
Please note, the shortcuts listed here are default shortcuts, feel free to customize your shortcuts as you would like.

Document Navigation Shortcuts


Ctrl+Up

Scroll up one line keeping cursor in view

Ctrl+Down

Scroll down one line keeping cursor in view

F4

Toggle focus between active file and Tree View if shown

Alt+Right

Position cursor at first not space character of next paragraph

Alt+Left

Position cursor at first not space character of current paragraph (if positioned mid-paragraph) or previous paragraph

Alt+Page Up

Position cursor beginning of first line in of the display

Alt+Page Down

Position cursor beginning of last line in of the display

Alt+'-' *NM

Position line with cursor at top of window

Alt+'+' *NM

Position line with cursor at bottom of window

Alt+"*" *NM

Position line with cursor at center of window

Ctrl+'1' *NM

Position the cursor at the end of the previous word

Ctrl+'2' *NM

Position the cursor at the end of the next word

Ctrl+F6

Make the next document window active

Ctrl+Shift+F6

Make the previous document window active

*NM : Will Only work on the numeric keypad.

Select/Delete/Insert Shortcuts
Ctrl+Left+Shift (or Right)

Selects the word preceding (or following) the cursor

Ctrl+Backspace

Delete the word preceding the cursor

Ctrl+Delete

Delete the word following the cursor

Ctrl+I

Insert a literal character at the cursor position

INS

Toggle between Insert and Overstrike mode

Hex Mode Shortcuts


Ctrl+H

Toggle HEX editing mode

Ctrl+D

Insert or delete characters in HEX editing mode

Bookmark Shortcut
Ctrl+F2

Toggle bookmark on and off

F2

Goto next bookmark

File Menu
Ctrl+N

Create a new document file

Ctrl+O

Open an existing document file

Ctrl+Q

Open an existing document without showing File Open dialog

Ctrl+F4

Close an existing document file

Ctrl+S

Save the active document

F12

Save the active document as a new file

Ctrl+P

Print the active document

Edit Menu
Ctrl+X

Cut text from the document into the clipboard

Ctrl+C

Copy text from the document into the clipboard

Ctrl+V

Paste text from the clipboard into the active document

Ctrl+0-9

Select active clipboard

Ctrl+A

Select All text in the active document

Ctrl+Z

Undo the last action if possible

Ctrl+Y

Reverse the last Undo action if possible

Ctrl+J

Select the current word (same as double click)

Ctrl+E

Delete line the cursor is on

Ctrl+F11

Delete from the cursor to start of line

Ctrl+F12

Delete from the cursor to end of line

Ctrl+W

Toggle Word Wrap on/off

F7

Insert time/date at cursor

Search Menu
Alt+F3 or Ctrl+F

Find a character string

Ctrl+F3

Repeat last find toward beginning of file

F3

Repeat last find toward end of file

Ctrl+B

Find matching brace (,[,{ or },],)

Ctrl+R

Find and replace a character string with another

Ctrl+G

Goto the specified line (or HEX address)

View Menu
Ctrl+U

Toggle File Tree View

Ctrl+F8

Toggle Tag List

Format Menu

Ctrl+T

Reformat the current paragraph or selected text

Ctrl+F5

Convert selected text to lower case

ALT+F5

Convert selected text to Upper case

F5

Capitalize first character of each word in selected text

Shift+F5

Invert case of all characters in selected text

Ctrl+K

Invoke the spelling checker

ALT+C

Toggle column/block mode on and off

Macro Menu
Ctrl+M

Replay a macro

Ctrl+L

Replay a macro the specified number of times

DOS Menu
F9

Run DOS Window command

Ctrl+F9

Repeat last DOS Window command

F10

Execute Windows Program

Help Menu
Shift+F1

Invoke the context help command and cursor

Keymapping & custom menu hotkeys


Anyone who has used UltraEdit/UEStudio for a while will probably tell you that one of the reasons they love it so much is, "almost
EVERYTHING is customizable". Take a look at the product testimonials, and you will get the sense that our users feel
UltraEdit/UEStudio was designed just for them.
Neither of these sentiments are by accident. We have expended considerable effort to ensure that almost everything in UltraEdit and
UEStudio is customizable because we want you to feel that they are a "perfect" fit for the task you use them for.

Many of our users need to change/tweak the interface so they can increase their productivity and ease of use. With that in mind, we made
the menu hotkeys and key mappings totally customizable. If you've ever wanted to change menu hotkeys or keymappings, you've come
to the right powertip.

Custom Menus and Hotkeys

Step 1. Customizing Menu Hotkeys


The hotkeys are the underlined characters you see when you hit ALT. These keys help you navigate through menus without using your
mouse.

You can edit the hotkey used in the customize menu dialog. Right click on the Menu and select "Customize Menu"
When the Menu Configuration dialog opens, you can select the entry (for which you would like to customize) and click edit.

The hotkey is the character immediately following the ampersand character (&). You can move, or remove, the ampersand character to
change the hotkey.

After hitting 'OK', you will see the hotkey has changed for the entry.

Step 2. Customizing Key-Mappings (Chords)


UltraEdit and UEStudio allow you to define Multi-Key Key-Mappings sometimes referred to as chords. This allows you to greatly
expand your options when defining Key-Mappings for the many functions available in UltraEdit/UEStudio.

To create a key mapping:


You can create a single key mapping, or use both text fields to define a "chord". For example:
Ctrl+R, M: Can be used to "Open the File Under Cursor" when "CTRL+R, and M" are pressed in quick succession.
To configure this chord, hit CTRL + R, which will populate the first field, the click on the second field and hit M. Now when you hit
CTRL + R, then M, it will open the File Under Cursor".
You can set the Multi-key Delay value to extend/shorten the time allowed to enter multi-key shortcuts, rather than having the first portion
of a multi-key shortcut processed on its own.
To remove a key mapping:
1. Select the command you wish to modify from the Commands list.
2. Select the existing key assignment from the Existing keys list.
3. Click on the Remove button and the key assignment will be removed.
To output all currently defined key mappings/shortcuts
List all currently configured keyboard shortcuts (for use with UltraEdit/UEStudio) by clicking on the Show Key Mapping in Editor
button. The key mappings will be written to a file with the format "[Editor Name].shortcuts".
This will include standard keyboard shortcuts, menu shortcuts, and macro hotkeys. If Sort by Keys is selected the list will be sorted
based on the shortcut keys for each function. If Sort by IDs is selected this list will be sorted based on the command names. Print the list
for a quick and easy reference guide.

Backup your Key Mapping file


The keyboard mapping file is stored (and searched for when the editor starts) in the same directory as the .INI File. The filename is the
same as the INI with the .KBD extension, i.e. UEDIT32.KBD or UESTUDIO.KBD.
As of UltraEdit v12.20 and UEStudio v06.00, the file name of the key mapping file is now uedit32.uek/uestudio.uek instead of
uedit32.kbd/uestudio.kbd.

Column Markers
Whether you are composing simple text, or programming complex nested logic, the column markers serve as an indentation guide to
make it easier to read your file and to ensure that your formatting is correct. You can use just one column marker or multiple markers.

Column Markers
The benefit of a column maker is that it can help you to format your text/code, or in some cases to make it easier to read complex nested
logic.
You can enable the column markers in the Set/Show Column Markers dialog in the View menu.

Set Column Markers


The Set Column Markers dialog allows you to create multiple sets (or groups) of column markers which may be used for any number of
purposes. For the purpose of this power tip, we will create 2 column marker groups. The first group is intended for a document with a tab
width of two spaces (column markers at columns 2, 4, and 6). The second group for a tab width of four spaces (column markers at
columns 4, 8, and 12).

Step 1. First, we will create the group. Click on the New button in the Column Groups section (top) to create the first group - we will call
this group "TwoSpaces".

After clicking on the New button, simply type the name "TwoSpaces". Hit the ENTER key to accept the changes.

Step 2. Now we will create the individual column markers. Click on the New button in the Column Markers section (bottom).

In the column number field type "2". Hit the ENTER key to accept the changes.

Note: If you wish to enable/disable the individual column markers, you can do so by checking/unchecking the checkbox in the Enabled
column.
Note: You may also use the Modify/Delete buttons to modify and delete (respectively) the individual Column Markers.
You can enter as many column markers as you wish. For the purposes of this power tip, we will create two more Column Markers - at
columns 4 and 6. Our "TwoSpaces" Column Group looks like the following when completed:

To create our second column group - called "FourSpaces" - we will repeat steps 1 and 2. The result is as follows:

Step 3. Finally, we need to activate the column markers. To do this, select the desired Column Group and click on the Set Active button.
Note: the light blue background for the TwoSpaces group indicates that it is the active group.

Click OK to accept your changes and to return to the edit window.


As you can see in the screenshot below, our TwoSpaces group is active, and a thin line is drawn vertically in columns 2, 4, and 6.

The TwoSpaces group allows us to quickly see the formatting structure for the file; however, when we switch to the outline.txt file, the
tab structure uses four spaces.

No problem, we can quickly activate the FourSpaces group to help us in this case. To do this, return to the Set Column Markers dialog in
the View menu. Select the FourSpaces group and click on the Set Active Button, then click OK.

As you can see in the screenshot below, our FourSpaces group is active, and a thin line is drawn vertically in columns 4, 8, and 12.

Setting the Color for the Column Markers


You can customize the display color for the column markers in the Set Colors dialog in the View menu.
To change the color, select the "Column Marker" entry, then click on the color button.

Quick Open
UltraEdit and UEStudio provide multiple methods to quickly open files without using the standard Open File dialog. A favorite method
among power users is the Quick Open in the File menu.
The benefit of the quick open dialog is that it loads up extremely fast and allows you to type the name of the file and open it quicker than
using the standard open dialog.

Quick Open Dialog


To access the quick open dialog, go to File : Quick open. Of course, most users who are interested in this feature would prefer to use
keyboard shortcuts. You can use the default hotkey which is CTRL+Q.

In terms of opening files, you are not limited to typing the full name/path, you can use multiple options in opening files with this
convenient feature:

Relative paths
ie: NewWindowsApp.h
The relative path will open a file based on the "Path" shown in the dialog. The path is populated based on the location of the active
file.

Wildcard
ie: *.txt
The wildcard allows you to open all instances of the given file type - in the "path" directory - with a single command.

Full file name/path


ie: c:\temp\notes.txt
The full file name/path allows you to open a file using the fully qualified name/path.

Open all matching files from subdirectories


The Open all matching files from subdirectories setting allows you to recursively search all subdirectories (of the specified path) and
open all files that match the specified name/wildcard pattern.

Quick Open Address Bar


The Quick Open Address Bar on the main toolbar supports the same commands as the Quick Open dialog (in the file menu).

Relative paths
ie: notes.txt
The relative path will seek to open a file based on the "Path" shown in the dialog. The path is populated based on the location of the
active file.

Wildcard
ie: c:\temp\*.txt
The wildcard allows you to open all instances of the given file type - in the "path" directory - with a single command.

Full file name/path


ie: c:\temp\notes.txt
The full file name/path allows you to open a file using the fully qualified name/path.

Drag-N-Drop Split Pane Editing... Vertical/Horizontal Split Window


The horizontal/vertical split feature may not sound like one of the "must have" feature, but when you need a quick and easy way to edit
your files side-by-side you certainly can't live without it. This is a convenient feature when you're manually comparing files, when you
want to copy/paste between multiple files, or when you simply want to divide up your edit space.
Note: In order to use the vertical/horizontal split window, you need to make the tabs "Undockable". You can change this configuration
setting in Advanced : Configuration : Application Layout : File Tabs : Operation by unchecking the "Dockable" tabs option.

Vertical Split
Splitting the window vertically is as easy as a drag and drop. To split the window vertically, simply click on an open file tab, and drag it
into the editor. As you drag the tab down toward the editor, you should see the cursor change to include a "page" on the mouse arrow.

When you release the mouse, you'll see the window has been split vertically.

As you might expect, you can resize the edit area for both "panes" by dragging the middle divider bar.
If splitting the edit pane once isn't enough, simply repeat the process and split it again - giving you 3 edit panes!

To restore the edit space to the original (single) pane, simply drag the file tab back to the 1st edit pane.

Horizontal Split
To split the window horizontally, you follow the same process (drag the open file tab into the editor. However, in order to split the
window horizontally, you must drag the file tab down to the bottom of the editor and touch the horizontal scroll bar.
When the mouse is positioned on the horizontal scroll bar, you will see a faint rectangle drawn around the editor.

The window will split horizontall when you release the mouse.

Tabbed Child Windows


UltraEdit includes many useful dockable child windows such as: the function list, tag list, clipboard history, bookmark manager, etc. If
you use UltraEdit like you do, you want these dialogs available as you're working. But, if you were to dock all of these dialogs along the
side of the editor, you would be left with little-to-no room for the information contained in the windows - making the windows difficult
to use.
Version 15.00 gives you the ability to tab your child windows so you can dock multiple child windows on the editor, without sacfrificing
usability.

1. Docking the Child Windows


Version 15.00 includes an all new docking control making it easier than ever to position/dock your windows. In addition to the new
docking control, v15.00 also includes a tabbing feature.
To tab your child windows, undock (or float) the windows you wish to tab by double-clicking on the title bar.

Now that the dialog is floating, click and drag the window to the position you wish to place it in. You should then see the dock control.

To tab the child windows, drag the mouse cursor to the (middle) tabbed icon in the docking control. You will see the background of the
dialog turn blue. When you see this, release the mouse button.
You will now see your child windows are occupying the same area, but individually accessible via tabs.

Auto-Hide Child Windows


When you're deep in your code, the most important thing is editing space. You don't want your edit space cluttered with dialogs and
windows, then again... you want the functionality offered by those windows.
The all new auto-hide child windows give you the best of both worlds. Simply hide the windows along the edge of the window so they
are there when you need them, yet out of the way while you're coding.

1. Hide the Child Windows


To set your child windows to auto-hide, simply click on the tack icon in the upper right corner.

As you'll see, the child window will dock against the edge of the editor.

To unhide the window, simply rollover the tab with your mouse. The child window will expand allowing you to access the functionality
of the window.

2. Un-Hide the Child Windows


To un-hide the windows, simply click the tack icon. This will cause the child window to remain in it's docked position.

Customizing Toolbars
Have you ever wanted to customize the look and feel of UltraEdit's toolbar buttons?
A principle cornerstone of UltraEdit is its highly configurable user interface. Designed with your preferences in mind, UltraEdit allows
you to configure your menus and toolbars exactly as you would like to see them. Beyond this, you may also add your own tools to the
toolbar, create your own toolbars, or create custom icons for your toolbar!
In the below tutorial, we will show you how to easily and quickly configure your main and custom toolbars.

1. Customize the main toolbar


To customize the main toolbar, simply right-click on the toolbar itself. Select the "Customize Toolbar..." option.

The following dialog contains two frames: the toolbars (on the left) and the available commands (on the right). The toolbars frame is an
actual mapping of your current toolbar items. By default, the main toolbar is expanded and all main toolbar items are shown; however
you can collapse this and see other available toolbars by clicking the gray box next to the heading "Main ToolBar".
To add an item to your main toolbar, scroll through the list of commands on the right. For our example, we'd like to add the FTP
browser icon to our toolbar. Normally the FTP browser can only be accessed under File -> FTP/Telnet -> Browse. By adding this item to
our main toolbar, we can access the browser with one click.
Scroll down the list of commands, which are sorted in alphabetical order. Find the entry for the "FTP/SFTP Browser", select it, then
click the LEFT arrow button to add it to your main toolbar.

Once you've done this you will see the FTP browser item in your main toolbar mapping as shown below.

To change the position of your newly-added item on the toolbar, make sure it is selected, then press the UP and DOWN arrows in the
middle of the dialog to move it to the appropriate position (as shown in the below screenshot).

Once you have moved your new toolbar item to the position you'd like, press OK to close this dialog. UltraEdit will update its main
toolbar and you will see your new toolbar item exactly where you positioned it.

2. Creating a new custom toolbar


Sometimes it is necessary to create an entirely new toolbar for new toolbar items. This is very easy to do and follows many of the same
steps used to add a new toolbar item.
We would like to add a new toolbar for all three FTP commands (Browse, Open from FTP, Save As to FTP). In order to do this, we
will once again access the toolbar customization dialog by right-clicking on our toolbar and selecting "Customize Toolbar..."
At the top right of this dialog, you will see a text field labeled "New ToolBar:". Type in the name of your new toolbar here and press the
arrow button to add it to your list of toolbars in the left frame. We will call our toolbar "FTP".

In order to view our new FTP toolbar only, we can collapse the main toolbar by clicking the gray icon next to its heading, as shown in the
below screenshot.

Next, select the new toolbar. Look in the right frame for the specific commands you'd like to add to your new toolbar. We will add the
"FTP/SFTP Browser", "Open from FTP", and "Save As to FTP items". Select them one-by-one and click the LEFT arrow button in
the middle of the dialog.
The below screenshot shows what our new FTP toolbar looks like after we have done this.

Click OK, and you will see your new toolbar, complete with all commands you added, above the editor window.

In order to move the position of the toolbar, "grab" the vertical line at the beginning of the toolbar and drag it to the desired position. In
our example, we have positioned the FTP toolbar right before the main toolbar.

3. Replacing a toolbar icon with a custom icon


You can also change the look of your toolbar icons. In order to do this, you will need to have a premade 16 pixel by 16 pixel Windows
bitmap image you'd like to use to replace an existing toolbar icon.
In order to do this, access the toolbar customization dialog by right-clicking on your toolbar and selecting "Customize Toolbar..."
For our example, we would like to replace the FTP browse toolbar icon with one of our own. We will select and expand the FTP toolbar
from the toolbars frame, then select the FTP/SFTP Browser toolbar item.
At the bottom of this frame is a text field labeled "Ext. Bmp:". This is where you may define an external bitmap image for your toolbar
item. Click the ellipsis ("...") button to define the location of your bitmap.

Navigate to your bitmap, select it, press OK, then press OK again to save the change and add the new icon to the toolbar as well as
escape the toolbar customization dialog. Our new FTP browse icon is shown in the screenshot below.

That's all there is to it! You can customize your toolbars to the fullest extent to fit your editing needs and match your style.

File Tab Functionality


Can a tabbed interfaced editor have style? We think so!
UltraEdit v15 and UEStudio v09.10 and later versions introduce an exciting new file tab framework and now group tab features into two
basic states: docked or fixed. (Colored tabs are optional.)

Dockable file tabs


Dockable file tabs are the new default file tab style in UltraEdit/UEStudio. These file tabs can be docked and undocked (floating) by
simply clicking and dragging the "Open files" window title bar. Additionally, dockable file tabs provide window cascading and tiling
support while fixed tabs do not.

Dockable file tabs will automatically resize to accommodate new tabs as new files are opened. You can also manually resize the file tabs
window by clicking and dragging the bottom border on the file tab window, giving you full control over your tab overflow; expand the
file tab window to show all tabs or collapse it to show only one or two rows.
Additionally, you can completely hide your file tabs window to free up edit space by clicking the auto-hide icon (the pushpin at the top
right). When you do this, your file tabs will minimize to a single "Open Files" tab. To pull up your tabs again, simply hover over the
minimized "Open Files" tab. Conversely, when the cursor is moved off of the open file tabs window, it will minimize again to its original
state.

Furthermore, as the name suggests, dockable file tabs can be undocked into a floating state. To undock the file tabs, click and drag the
"Open files" title bar away from its current position.

Fixed file tabs


Fixed file tabs are the opposite of dockable file tabs in that they are fixed at the top of the edit window and cannot be undocked or
floating. Fixed file tabs provide a very unique and powerful way to split the edit window. To do this, simply click and drag the file tab
you'd like to split to the lower part of the edit window (for a horizontal split) or to the rightmost part of the edit window (for a vertical
split).

You can split the window as many times as you want and drag as many tabs as you need to any of the split windows, providing you even
more edit window management authority.

"I love the new active tab differentiation! The bar along the top would have been perfect in and of itself, but the bold, the italics, and the
saturation are brilliant additions."
- Brian K.

General file tabs configuration


Tabs are part of how we work. They signal to us file type by extension and color. On the tab itself is the name of the file, if the file is
active or not, saved, modified, or temporary. The tabs also provide a close icon on the tab as well as double click functionality for a new
tab and drag-and-drop functionality for a split (horizontal or vertical) view. One can even access a context menu for further options by
right clicking on the tab.
No feature of UltraEdit/UEStudio would be complete without the ability to configure and customize it any way you choose. UE v15 and
UES v09.10 provides a variety of configuration options to set your file tabs up the way you want them. The file tabs advanced
configuration is still available in the same place (Advanced -> Configuration -> Application Layout -> File Tabs), but the options have
expanded somewhat.

The options in the "Miscellaneous" dialog are generally the same from previous versions. They include the following:
Double-click tab will close file
Setting this allows you to double-click a file tab to close it. This option is selected by default.
Middle-button-click will close file
Setting this allows you to middle-click a file tab to close it. This option is selected by default.
Move to nearest left tab after current tab is closed
This setting will cause UltraEdit/UEStudio to shift to the nearest file tab once the current one is closed. If this option is not selected,
focus will shift to the tab associated with the last active file when the active file is closed.
Sort Tabs on File Open
If this option is selected UltraEdit will automatically sort your file tabs alphabetically as each file is opened.
The options in the "Operation" dialog allow you to control how the file tabs work.

These options - plus the option to display file tabs at the bottom - are also available via right-clicking on the file tabs and then in the File
Tabs flyout menu.

Tab overflow options


You have three options for managing your tab overflow: a single row of tabs with horizontal scrollers, a single row of tabs with a drop
down "open" file list, and multiline tabs.

Tab close button options


There are three settings for the file tab close button: 1. none, 2. on the tab bar, and 3. on the active tab. Additionally, like in Firefox, you
can now middle-click a tab to close it.

Tab coloring options


Finally, you can control the file tab colors by assigning different extensions to different colors. You can optionally completely disable file
tab coloring as well.

Creating user and project tools


UltraEdit-32/UEStudio allows you to configure DOS or Windows commands to make your tasks easier. You can configure up to 50 tools,
25 project tools and 25 standard tools. You can add your tools to the menus/toolbars and even map keyboard shortcuts to your tools.

Creating a Tool
To open the tool configuration dialog go to the Advanced Menu and click on the Tool Configuration option. If you want to configure a
project specific tool, click on the Project Tool Configuration option.

Note: In order to use project specific tools, you must have a project open. You can create a project in the Project menu.

Step 1: Configure the Tool Commands


After you've clicked on the tool configuration option, you will see the Tool Configuration dialog:

Any changes to your tools in this dialog can be saved by pressing the OK or Apply buttons.
For our example, we will configure a tool to list the contents of our working directory, using the DOS "dir" command. We'll begin by
configuring the "Command" tab of the Tool Configuration Panel.
Menu Item Name
It is best to name your tool with a short, descriptive title so you can easily identify it later. We will call this tool "ListDir."
Command Line
This is the command line that will be invoked when the tool is run.
The command line accepts and understands a handful of variables. We suggest you familiarize yourself with the available variables
because the variables can help you to create powerful tools. We will not cover all the variables in this Powertip, but for your information
some of the more commonly used variables are as follows:

%P Path only ("C:\project\test\")

%N fileName only ("test")

%E Extension only (".c")

%F Fully Qualified path and file name ("C:\project\test\test.c")

%P%N%E is equal to %F which is ("C:\project\test\test.c") in the example above.


For our tool, we want to list the active directory's contents, so we will use the command "dir %P". When executed, the tool will list the
contents of the current file path (%P).
Working Directory
This is the working directory for the specified command. If it is applicable, the process will be started using this as its working directory.
Our example does not require a working directory so we will leave this field blank.
Toolbar/Bitmap Icon
You can use this to specify a bitmap or icon to be used on the toolbar for the tool.
Tool List Pane
All of your defined tools will be listed in the Tool List pane. You may rearrange the tools by selecting them and using the Up and Down
buttons to move the selected tool in the list.

Step 2: Configure the Tool Options


The "Options" tab in the Tool Configuration dialog is used to define options for the currently selected tool.
Program Type
Here you will need to define which type of program the tool will invoke upon use. Since we are using DOS commands, we will set this
to "DOS.".

Save Active File


If this option is checked, the active file will be saved before the tool is run; otherwise it will not save the file. The exception to this is if
Save all files first is checked.
Save All Files First
If this option is checked, all open files will be saved before the tool is run.

Step 3: Configure the Tool Output


Define your Output options in the "Output" tab.
Command Output (DOS Commands ONLY)
DOS command output may be optionally captured to a file. The four options for DOS command output are:
1.

Append to Existing (create new file if one does not exist)

2.

Replace Existing

3.

Create New File

4.

Output to List Box (Output Window)

Show DOS Box


If this option is checked, a DOS window will be shown as the command is being executed, otherwise the DOS window will be hidden.

Capture Output
If this option is not selected then neither the output of the tool or any associated error output will be captured.
Replace Selected Text With
If you enable (check) this option, the captured output or contents of the clipboard will be used to replace the current selection (or inserted
at the cursor position if no selection). If no replace is selected, the output will be displayed as normal.

Step 4: Adding the Tool to the Main Toolbar


After you've created a tool, you can easily add it to the toolbars in the advanced configuration.

Customize the Toolbar


You can access the Toolbar Customization panel in the Advanced menu item Configuration : Toolbars / Menus : Customization. Click
"Customize Toolbar" to add your tool to the main menu.

Inside the Toolbar Configuration panel, scroll down in the "Commands:" list to the tool you've configured. In our example, "User Tool
1."
You can tell which tool number you've configured by looking at the tool's icon in the Advanced menu. Select the tool and press the Left
arrow button to add the tool to your Main Toolbar. You can then use the Up and Down arrows to adjust the position of the tool in the
toolbar.

Click "OK" and you will see the tool exactly where you positioned it on the Toolbar. When clicked, your tool will execute.

Step 5: Assign a Hotkey for your Tool


UltraEdit-32/UEStudio also allows you to assign hotkeys for your tools. You can do this in the Key Mapping dialog in Advanced :
Configuration.
Select your tool from the "Commands" list (it will be in the "Advanced" Command group since it is located in the Advanced menu), then
simply click on the "Press New (Multi-)Key" text field to key in your tool's hotkey.
We assigned our "ListDir" tool as Ctrl + Shift + D.

Working with temporary files in UltraEdit/UEStudio


UltraEdit and UEStudio use temporary files... but what are temporary files? The following power tip provides an explanation as to why
the editor uses temporary files as well as some tips to get the most out of temp files..

What are temp files?


Temp(orary) files are a sort of "backup" file that UltraEdit creates and uses during your editing sessions on a per-file basis (when a file is
opened) to store changes, while not actually changing the file on disk. Most editing software (Microsoft Word, Notepad, Dreamweaver,
etc.) uses a temp file in order to provide undo (and other) functions. When you edit a file with temp files enabled, which is how UltraEdit
works by default, you are actually editing the temp file and not the original source file stored on your hard drive. Once you save your
changes, UltraEdit replaces the file on disk with the current temp file -- almost like a version control system.

Why use temp files?


Without temp files, any changes you make to your file is written directly to the hard drive where it is stored, and every single keystroke
that results in a change to the file is permanent. Additionally, when you open and edit a file directly on the hard drive on Windows
systems, the operating system provides exclusive access of the file to the application that opened it, meaning no other application can

open the file as it is "locked" by the program working with it. Temp files also provide file recovery; if you're editing a file in UltraEdit
and your computer crashes or reboots unexpectedly, the temp file in its last-modified state will still be available to you when you restart
the application.

Some loss of functionality if you edit without temp files...

Revert to saved is no longer available

File change detection and polling could not function

The file would be "locked" exclusively for your UltraEdit session and unavailable for other users or applications

Where are temp files stored?


Most Windows applications (UltraEdit included) write temp files to your system %temp% directory. To see where this is, go to Start ->
Run, type %temp% and press Enter.

How do I turn temp files on or off?


You should not turn temp files off unless you are working with very large files or unless you simply don't want to use temp files for
some reason. If you are working with very large files with temp files enabled, then temp files may actually slow your system down as it
copies the original source file into the %temp% directory. If you are not using temp files, you will receive a warning prompt from
UltraEdit that all of your changes will be permanent.
Should you wish to disable temporary files, you may do so by going to Advanced -> Configuration -> File Handling -> Temporary Files.
Select either "Open file without temp file but prompt for each file..." or "Open file without temp file but NO prompt...".
With either of these options set, you can then provide a filesize threshold for this setting. For instance, setting the "Threshold for above"
option to 20000 will disable temp files ONLY for files exceeding 20 MB in size. This is highly recommended if you decide to disable
temp files.
UltraEdit v14.20 and later provides an automatic detection mechanism to warn you that temp files are enabled when opening large files
as shown in the screenshot below:

Here is an explanation of the options above:

1. Yes, for this session only


Selecting this option will turn off temporary files for this edit session only (your "edit session" ends when you close the application) for
files that are over approximately 47 MB in size.
2. Yes, and don't ask again
Selecting this option will turn off temporary files permanently for files that are over approximately 47 MB in size.
3. No, use temporary files when opening files larger than 47 MB
Selecting this option will keep temp files enabled for files exceeding 47 MB (all large files).

Backup and Restore Settings


One of the staples of UltraEdit (and UEStudio) is its highly configurable interface and features. However, what happens when you're
moving to a new system and you want to port your settings and customizations over along with UltraEdit?
Instead of copying each individual INI, setting, or customization file, you can do this very easily using UltraEdit's "Backup / Restore
User Customizations" feature.

1. Open the Backup / Restore User Customizations dialog


To access this feature and backup your settings, select it from the Advanced menu. (Note: if you cannot see this option in the Advanced
menu, you may need be using Basic menus. Please right-click on the main menu and select the "Advanced" option.)

You will see two tabs here - both a "Backup" and "Restore" tab. Since you're backing up your settings first, you'll want to use the
Backup tab.

This dialog is also resizable. The list of settings to backup can be rather extensive, so it is extremely useful to be able to expand the size
of the dialog.

2. Select the settings/customizations you'd like to save


From the dialog, select the customizations you'd like to back up. A brief description of these customizations follows.
Application Menus - the main menu across the top of the application window
Popup Menus - the popup menu you see when you right-click the edit area

Toolbars - the main toolbar and icons, along with any custom toolbars you've saved
Template Lists - includes templates; more information on templates is avilable here
Environment Data - the default environments along with any custom environments you've saved; more information on environments is
avilable here
Others - includes the uedit32.ini file, the wordfile as well as some legacy files (such as auto-saved toolbars and menus from previous
versions).
Make sure you select both the uedit32.ini file as well as the wordfile.uew (or wordfile.txt) from the "Others" section. The INI file stores
most of your application settings, and the wordfile contains syntax highlighting definitions.

3. Choose the location where you'd like to save the backup


Once you've selected the settings and customizations you'd like to save, click the Browse button at the top of the dialog to choose a
location for saving the backup. You can save this locally, although you may want to save this to a flash drive, external hard drive,
network drive, etc., if you're porting your settings over to a different system.

4. Save your settings


Once you've selected an appropriate location for saving the backup, simply click the Backup button. You should see a prompt showing
you the settings that were saved. The file will be saved as a ".uec" file.

5. Restore your settings


Once you've backed up your settings, you can restore them to (i.e. transfer them to) your new system with your new installation of
UltraEdit very easily. Simply access the "Backup / Restore User Customizations" dialog again under the Advanced menu item, except
this time click the Restore tab. Next, click the Browse button to locate the .uec file you saved in step 4 and click Open.

Use the checkboxes to check the customizations from the .uec file you'd like to import. If you'd like to import everything, just check the
category checkboxes and all subitems will automatically be checked as well.
Finally, click the Restore button to import your settings and restart UltraEdit. Now you have your previous editing environment on your
new system!

Add a webpage to your toolbar


Did you also know that UltraEdit provides you with an interface for accessing the command line with the click of a button? Furthermore,
you can build custom tools in UltraEdit that act upon the current file or selected text in the editor with the Windows command line. This
gives you the power of integrating any external application, such as an internet browser, with your daily UltraEdit editing environment!
Here are just a few very basic things you can do with UltraEdit's custom tools:

Open your favorite browser

Access your favorite webpage(s)

Highlight a word or phrase and search it on your favorite search engine (click here to learn how)

Check your HTML/CSS edits across multiple browsers for consistency (click here to learn how)

Add your current file to a Zip archive


Read on to see how you can implement your favorite webpage tools in just a couple of quick and easy steps!

Add a Webpage to Your Toolbar


In order to follow this tutorial, it will help you if have a thorough understanding of user tools and toolbar customization.

To learn more about user tools, please visit our Power Tip "Creating User and Project Tools".
To learn more about customizing the toolbar in UltraEdit, please visit our Power Tip "Customizing the Main Toolbar".

1. Create the User Tool to Launch the Webpage


You will need to create a custom tool that will launch a specific webpage in the browser of your choice before you can add this to your
toolbar. In order to do this, go to Advanced -> Tool Configuration and click "Insert". Name your new tool something that will help you
remember it. For our example, we will create a tool that launches www.ultraedit.com in a Firefox browser window.
Note: To learn more about running your favorite applications (web browsers, parsers, syntax checkers, etc.), search the help files of those
applications for command line tips. For this Power Tip we will use Firefox's command line parameters; you can choose to use a different
browser if you'd like.

Enter the appropriate command line parameters, working directory, and custom bitmap (optional) under the "Command" tab as shown
below.

Under the "Options" tab you should not have to configure anything. We have left this at its default settings (Program Type: DOS,
nothing else selected).
Under the "Output" tab we have left almost everything at its default, however we have unchecked "Capture Output" for this tool. A
screenshot of our settings is below.

Finally, click OK to save your new tool.

2. Add the New Tool to the Main Toolbar


Access your toolbar configuration by right-clicking on the main toolbar and selecting "Customize Toolbar..." You can add your new tool
by scrolling down to the user tools in the "Commands:" frame. Once you've located your tool, select it and press the LEFT arrow button
to add it to the main toolbar. Use the UP and DOWN buttons to position your new tool exactly where you'd like it.

Click OK to save your toolbar customization and escape the toolbar configuration dialog. You will see your new tool on the main toolbar
where you positioned it. Click on the icon to test your new toolbar item.
Below is a screenshot of our new tool with the Firefox icon. When clicked, a Firefox browser window will open and load
www.ultraedit.com.

Integrate Yahoo!, Google, Wikipedia and more with UltraEdit


Have you ever opened a PHP, C/C++, or Java file and wondered what a specific function does? Have you ever opened a text file and
googled an unfamiliar technical term or phrase? This tutorial will show you how to access the information you need in your browser by
simply highlighting your text in the edit window and clicking your toolbar button.

In our Power Tip "Add a webpage to your toolbar" we looked at how UltraEdit's powerful custom tool feature provides command line
interaction directly from the editor window. This simple yet powerful functionality uncovers a vast array of opportunities to integrate
your favorite text editor with your favorite application or webpage.
In this tutorial, we will look dig a little deeper into the possibilities of this feature. We will set up a custom tool to integrate search
engines with UltraEdit; specifically to pass selected text in the editor window via the command line to a search query URL in the
browser window. Simply put, we will set up a tool to search for selected text on our favorite search engine with the click of a button.

Integrate Your Favorite Search Engine with UltraEdit


In order to follow this tutorial, you will need to understand how to use and configure a custom tool. You can read more about UltraEdit's
custom tools at the following power tips:
Creating user and project tools
Add a web page to your toolbar
To learn more about customizing the toolbar in UltraEdit, please visit the following Power Tip:
Customizing the main toolbar

1. Run a Search on the Search Engine in the Browser Window


In order to set up your tool to interact with the search engine via your browser, you will need to first perform a normal search on your
selected search engine from the browser window. Once you have done this, you will need to copy the URL from your browser's address
bar. You will be copying the search URL so you know what to pass along to the command line and where to place your selected text in
the search URL itself.

2. Copy the Search URL and Configure Your Tool


Next, you will need to configure a custom tool as described in our Power Tip "Add a Web Page to Your Toolbar". For the command
line, you would use the copied search URL. In our example, we set up a tool to search Google on Firefox, so our command line looked
like the following:
Firefox http://www.google.com/search?q=Unicode
Where "Unicode" is our search term.
Remember, the working directory will be the directory where your browser of choice is installed, and you must call your browser in the
command line.
Note: For a list of some command-line parameters for commonly used website search URLs (Yahoo, Dictionary.com, Php.net, etc.) click
here.

3. Add the %sel% Parameter to the Tool's Command Line


The %sel% parameter is a special parameter for configuring tools. When this parameter is included in the command line, UltraEdit will
replace it with whatever text is selected in the currently open edit window.
Replace your search term with the UltraEdit parameter %sel%. This will cause UltraEdit to insert the currently-selected word or phrase
in the editor window into the command line. Your final command line parameter for a Google search on selected text would look similar
to the following:
Firefox http://www.google.com/search?q=%sel%

Note: For more command line variables, click the "Help" button in the Tool Configuration dialog.
Note: If your search query URL includes the ampersand (&) symbol, you'll need to enclose your command line URL in quotes as shown
below:
Firefox "http://www.google.com/search?sitesearch=www.w3schools.com&as_q=%sel%"
Now every time you highlight a word or phrase and click your tool, a browser window will launch with search results for that phrase
from your favorite search engine. You can set up a tool to search Google, Wikipedia, Dictionary.com, and more... nearly any search
engine you like. The possibilities are endless!

Some Common and Useful Search Engine Query URLs


Here are some command line parameters that we used for search queries on different websites.
Search Engines:
Google: http://www.google.com/search?q=%sel%
Yahoo!: http://search.yahoo.com/search?p=%sel%
Informational:
Wikipedia: http://en.wikipedia.org/wiki/%sel%
Dictionary.com: http://dictionary.reference.com/browse/%sel%
Thesaurus.com: http://thesaurus.reference.com/browse/%sel%
Whois Lookup: http://www.whois.net/whois_new.cgi?d=%sel%
Answers.com: http://www.answers.com/main/ntquery?s=%sel%
Development/Programming:
PHP.net: http://us3.php.net/manual-lookup.php?pattern=%sel%
cplusplus.com: http://www.cplusplus.com/query/search.cgi?q=%sel%
W3 Schools (Javascript/HTML/AJAX and more): "http://www.google.com/search?sitesearch=www.w3schools.com&as_q=%sel%"

Installing UE3 on your U3 smart drive


The ability to carry UltraEdit wherever your travels or business take you, and run it on almost any computer, is the pinnacle of flexibility
and portability that many users seek. Since the U3 operating system leaves no footprint whatsoever on the host computer, you can do all
this without having to add or modify configuration files on your hard drive or registry.
The UE3 version of UltraEdit allows you to carry a mobile editing environment bridging your work PC, home PC, and laptop.

Installing UE3 on Your U3 Smart Drive


Installation of UE3 requires a U3 equipped smart drive platform. If you have a U3 smart drive, please insert the drive into your computer.
If you insert your U3 drive, and the launchpad does not run, please click here to see the steps to run the launchpad
Click here to download the UE3 software installation files. After you have downloaded the .zip file, extract the contents of the .zip file to
a location on your local system.

Step 1: Open the Launchpad


Click on the U3 logo in your system tray and select "Add Programs" from the Launchpad. You will see a pop-up menu with 3 choices,
select "Install from My Computer" from the menu.

Step 2: Navigate to the UE3.u3p File


Please Note: If you haven't already downloaded the UE3 installation files, please click here to download the UE3 software installation
files. After you have downloaded the .zip file, extract the contents of the .zip file to a location on your local system.

After you have clicked on the "Install from My Computer" (from Step 1), you will need to navigate to the directory where you unzipped
the "ue3.u3p" package to. Select the file and press the Open button.

Step 3: Add Program Wizard


You should now see the install wizard, click "Next" in the "Add Program Wizard" to step through the installation.

After the wizard has completed the install of the software you will see a message stating that the software installation was succesful.

The installation is complete, you may now click "Done".

Step 4: You are Done!


The software is now installed. Enjoy your use of UE3 on your U3 Smart Drive.
To Use UltraEdit on the U3 Smart Drive:
If you click on the U3 logo to open the U3 Launchpad you should now see UltraEdit UE3 in the list of programs available for use.

Running the Launchpad: Opening the U3 Launchpad


Please note: If the U3 launchpad is already running in your system tray, please continue to step 2.
In order to install UE3, the U3 launchpad must be running in the system tray. You can run the launchpad by doing the following:
1. Open Windows Explorer:
To open Explorer, right click on your Start menu and select Explore.
2. Access the Contents of the Drive:
Expand the "My Computer" and look for reference to your U3 smart drive. On our system, the drive is E:\.

Double-click on the E:\ drive so you can view the contents of the drive.
3. Run the LaunchU3.exe:
After clicking on the U3 drive, in our example it is E:\, you should see the following files listed:
autorun.inf
Launchpad.zip
LaunchU3.exe
Double click on the "LaunchU3.exe" item to run the Launchpad. This will add the U3 Launchpad to your system tray. Please click here
to proceed to the beginning of this power tip.

Integrated scripting engine tutorial


Scripting in UltraEdit/UEStudio is enabled through embedding of the JavaScript engine. This allows users to enjoy the power and
flexibility of the JavaScript language while using the UltraEdit/UEStudio Application Object commands to interact with the editor or
documents open in the editor (Document Object commands).
The scripting engine supports the core functionality of JavaScript 1.7. Further information on JavaScript 1.7 may be found on the
associated Mozilla site.

Using the Integrated Scripting Engine

Step 1: Create the Script


Create your (JavaScript) script using UltraEdit/UEStudio. As mentioned above, you may use JavaScript 1.7 and the UltraEdit/UEStudio
Application Object commands and Document Object Commands.
There is extensive information in the Help regarding the commands available, however we have a few sample scripts below.

The script we've created above is a simple "Hello World" script which will write "Hello World" to the active document.

Step 2: Add the Script


Once you've created (and saved) your script you will need to add it in the Scripting : Scripts dialog.

Click on the "Add" button to add the script to the list. You will need to browse to the location of the script and, if you would like, type a
description of the script. The description will display in the Description field in the scripting dialog.

Once the script has been added, you can define a Hotkey/Chord for a quick and easy execution of the script.
When you are done, you may click OK.

Step 3: Execute the Script


To execute the script go to the Scripting menu. You will see your script name at the bottom of the "Scripts" menu. Click on the script
name to execute it. You can also use the Hotkey/Chord if you have defined them.

After executing the above script, you should see the following results:

Note: As the scripting does take advantage of the JavaScript language, you may also write this as a function:
// Hello World Example Script
function hello() {
UltraEdit.activeDocument.write("Hello World!")
}
hello();

Example Script - Retrieving String User Input


The scripting support allows you to prompt the user for String or Integer data, capture that data in a variable, then use the variable
accordingly. The methods used to retrieve the data are "UltraEdit.getValue" and "UltraEdit.getString".

Prompt for String Input


To prompt for String input use the "UltraEdit.getString" command. An example of prompting for input and capturing the input as a
variable is as follows:
var str = UltraEdit.getString("Please Enter a String:",1);
Capture Input:
In order to capture the data, and NOT write it immediately to the document, you must use the '1' parameter in the getString method.

Write Input:
If you would like to write the user input immediately to the file use '0' as the parameter value.

Sample Capture String Input Script


The example below prompts the user for a String and captures it in the variable "str". It will then write "You Entered user input (str)" to
the active document. It will write a different response depending on whether "UltraEdit" or "UEStudio" was entered.
If you would like, you may copy the script below and expand upon it.
function strInput() {
//Get user input
var str = UltraEdit.getString("Please Enter a String:",1);
//Output what was entered
UltraEdit.activeDocument.write("You Entered " + str + "\r\n");
//Conditional responses
if (str == "UltraEdit") {
UltraEdit.activeDocument.write(str + " has an integrated scripting engine.\r\n");
UltraEdit.activeDocument.write(str + " is a very powerful editor.\r\n");
UltraEdit.activeDocument.write("\r\n");
} else if (str == "UEStudio") {
UltraEdit.activeDocument.write(str + " also has integrated scripting\r\n");
UltraEdit.activeDocument.write(str + " includes all the functionality of UltraEdit and
more.\r\n");
UltraEdit.activeDocument.write("\r\n");
} else {
UltraEdit.activeDocument.write("Sorry, there is no defined output for " + str + "\r\n");
UltraEdit.activeDocument.write("\r\n");
}
} //end strInput
strInput();

Note: The command used to write to the active document is "UltraEdit.activeDocument.write"


The results after entering "Data", "UltraEdit", and "UEStudio" is as follows:

Example Script - Retrieving Integer User Input


The scripting support allows you to prompt the user for String or Integer data, capture that data in a variable, then use the variable
accordingly. The methods used to retrieve the data are "UltraEdit.getValue" and "UltraEdit.getString".

Prompt for Integer Input


To prompt for Integer input use the "UltraEdit.getValue" command. An example of prompting for integer input and capturing the input as
a variable is as follows:
var num = UltraEdit.getValue("Please enter an integer",1);
Capture Input:
In order to capture the data, and NOT write it immediately to the document, you must use the '1' parameter in the getValue method.
Write Input:
If you would like to write the user input immediately to the file use '0' as the parameter value.

Sample Capture Integer Input Script


The example below prompts the user for an integer value and captures it in the variable "num". It will write "You Entered user input
(str)" to the active document. It will then enter a loop in which it will write "i" number of lines, and number each line.
If you would like, you may copy the script below and expand upon it.
function intInput() {
//Get user input
var num = UltraEdit.getValue("How Many Lines:",1);
//Output what was entered
UltraEdit.activeDocument.write("You Entered " + num + "\r\n\r\n");
//Loop
var i = 1;
while (i <= num) {
UltraEdit.activeDocument.write(i + " \r\n");
i = ++i;
}
} //end strInput
intInput();

Note: The command used to write to the active document is "UltraEdit.activeDocument.write"


The result after entering "5" is as follows:

Example Script - Enumerate Through All Open Files

Using the Document Object commands, you may access/reference the files that currently open in the editor. If you would like to perform
an action/run a script against all open files you would need to retrieve the number of open files, and then loop through each file.
As an example, if you need to find out how many files are open in the editor, you could use the following:
var num_of_docs = UltraEdit.document.length;
If you need to reference a specific file, based on what it was opened, you can do so using UltraEdit.document[x]; where x is the number
of the document.

Sample Enumerate Through All Open Files


The script below will Enumerate through each open file and write a simple header to each file.
If you would like, you may copy the script below and expand upon it.
//
//
//
//
//

Hello welcome to the UltraEdit scripting environment. Normally you would


put a header comment at the top of a javascript file to be used in UltraEdit
in order to indicate the version of the UltraEdit scripting API like so:
Version = 1.00
However, this is currently not necessary since the API will default to 1.00.

//
//
//
//
//
//

---------------------------------------------------------------------------header.js
This script creates a header for all open documents
---------------------------------------------------------------------------UltraEdit is our application object. All UltraEdit operations will use this
object.

// Get the num of open documents.


var num_of_docs = UltraEdit.document.length;
var dashes = "// ------------------------------------------------------------";
dashes += "----------------\r\n";
// Enumerate through all open documents and add the header.
var index;
for (index = 0; index < num_of_docs; index++) {
UltraEdit.document[index].top();
UltraEdit.document[index].write(dashes);
UltraEdit.document[index].write("// Script Name: \r\n");
UltraEdit.document[index].write("// Creation Date: \r\n");
UltraEdit.document[index].write("// Last Modified: \r\n");
UltraEdit.document[index].write("// Copyright (c)20XX\r\n");
UltraEdit.document[index].write("// Purpose: \r\n");
UltraEdit.document[index].write(dashes);
} //end for loop

After running the above script, every open file now has the following header:

Enjoy the power of the integrated scripting engine!

Find - List Lines Containing String


The lists lines option can be a handy tool when searching because it presents all occurrences of the find string in a floating dialog box.
You can use the dialog to navigate to each instance by double-clicking on one of the result lines. Furthermore, you can copy the text to
the clipboard or even bookmark all occurrences in the file.

Enable List Lines Containing String


The List Lines Containing String option is available in the Advanced options of the Find dialog. If you don't see the Advanced options,
simply click the Advanced button to expand the Advanced options.

When you enter your search string, then click "Next", the List Lines Containing string dialog will open - populated with your search
results.

Navigate
To navigate to the occurence shown in the dialog, simply click on the line and the editor will position the cursor at that occurrence.
Similarly, you can highlight the line and click "Gotto".

Bookmark All, Clipboard, and Show Line Numbers


You can bookmark the lines that matched your search criteria by clicking the Bookmark All button.
The Clipboard option will copy all the text in the List Lines dialog into the clipboard.
Finally, enabling "Show line numbers" will display line numbers for each line displayed in the Lines Containing Find String dialog.

Auto Reset List Lines


The List Lines Containing Strings setting is "sticky", meaning that UltraEdit/UEStudio remembers the setting for future Find operations.
If you want the setting to be "non-sticky", you can enable the Auto Reset option in Advanced : Configuration : Search : Auto Reset
Settings.
This will cause UltraEdit/UEStudio to reset the option after each Find operation.

UltraEdit/UEStudio Scripting Access to the Clipboard Contents


UltraEdit/UEStudio offer a powerful scripting engine which allows you to automate frequent tasks. Among the many UltraEdit/UEStudio
specific functions, the scripting engine also includes a function to retrieve the contents of the clipboard.
If you are not yet familiar with the scripting functionality in UltraEdit/UEStudio, please click here to view the introduction to scripting
Power Tip.

Clipboard Commands
The scripting engine is built on a JavaScript framework, the clipboard commands are therefore a JavaScript array object which is a
property of the UltraEdit application object.
Unless other parameters are noted, the Clipboard Object commands are generally invoked using the following format:
UltraEdit.commandName();

The Clipboard Commands include the following: clipboardContent, clearClipboard, clipboardIdx, and selectClipboard.

clipboardContent
This command returns the contents of the active clipboard; however, you can also set/replace the contents of the clipboard.
Get the contents of the clipboard in a variable:
var clip = UltraEdit.clipboardContent;

Set the contents of the clipboard:


UltraEdit.clipboardContent = "Hello World!";

Append to the contents of the clipboard:


UltraEdit.clipboardContent += " Hello World!";

Modify the contents of the clipboard:


var clip = "Start -- " + UltraEdit.clipboardContent + " -- End";
UltraEdit.clipboardContent = clip;

clearClipboard
The clearClipboard command clears the contents of the active clipboard.
UltraEdit.clearClipboard

clipboardIdx
This command returns the index of the active clipboard. For example, if you are using user-clipboard number 3, the property would
return "3".
Note: This is a READ ONLY property, you cannot set the Clipboard number with this command. Use the "selectClipboard" command to
set/change the active clipboard.
var clipnum = UltraEdit.clipboardIdx;

selectClipboard
The selectClipboard command sets the active clipboard. You can specify a Clipboard number from 0-9.
Note: 0 = the Windows clipboard and 1-9 specifies user clipboards.
UltraEdit.selectClipboard(2);

UltraEdit/UEStudio scripting access to the output window


The UltraEdit/UEStudio scripting engine is designed to make the automation of your tasks easier. Simply stated, it is all about
automation. When you automate your tasks, you may require feedback. For example, you may need to know whether or not the task
succeeded, or you may need to pull quick reports based on data in your open files. The possibilities are endless.
The scripting engine provides you access to the built in Output window giving you the ability to generate and retrieve feedback from
your script.

UltraEdit/UEStudio Scripting Access to the Output Window


If you are not yet familiar with the scripting functionality in UltraEdit/UEStudio, please click here to view the introduction to scripting
Power Tip.

Output Window Commands


The scripting engine is built on a JavaScript framework, the outputWindow commands are therefore a JavaScript array object which is a
property of the UltraEdit application object.

Unless other parameters are noted, the Output Window Object commands are generally invoked using the following format:
UltraEdit.outputWindow.commandName();

The outputWindow Object Commands include the following: clear, copy, showOutput, showWindow, visible, write

clear
Clears contents of output window.
Parameters: (boolean) true/false
Example usage:
UltraEdit.outputWindow.clear();

copy
Copies contents of output window to active clipboard.
Parameters: none
Example usage:
UltraEdit.outputWindow.copy();

showOutput
Determines visibility of output from active script. If the output window is not visible, and this is true, output window visibility will be
toggled to support this.
Parameters: (boolean) true/false
Example usage:
UltraEdit.outputWindow.showOutput=true; UltraEdit.outputWindow.showOutput=false;

showStatus
Determines visibility of all status information in output window (script name, success/failure of script, and errror information).
Parameters: (boolean) true/false
Example usage:
UltraEdit.outputWindow.showStatus=true; UltraEdit.outputWindow.showStatus=false;

showWindow
Toggles visibility of output window.
Parameters: (boolean) true/false
Example usage:
UltraEdit.outputWindow.showWindow(true);

visible
Returns a BOOLEAN value indicating if output window is visible. Note, this is a READ ONLY property it does not control the behavior
of the output window.
Example usage:
var isVisible = UltraEdit.outputWindow.visible;

write
Write specified text to output window. This only supports writing one line at a time and may not include line terminators.
Parameters: (String) Text to write in quotes ("")
Example usage:
UltraEdit.outputWindow.write("This is a test.");

Output Window Commands Sample Script


There are many instances in which you may need access (programmatically) to the ouput window. To demonstrate some of the
capabilities, we have created a sample script that will find the instances of a Product ID number (in a CSV file) and generate a report (in
the output window) and copy it to the clipboard.
This type of application of the output window functionality is especially useful when you need to analyze data from a text file, but do not
wish to modify the actual file/data.
The primary Output Window Object commands used are "write" and "copy".
ProductReport.js
//This script requires UltraEdit v13.10 or UEStudio v6.30 or any later.
//Get user input
var findStr;
var x = 0;
var lineNum;
var ordersArr = new Array();
//Clear the output window, make it visible and disable status information.
UltraEdit.outputWindow.showStatus=false;
UltraEdit.outputWindow.clear();
if (UltraEdit.outputWindow.visible == false) {
UltraEdit.outputWindow.showWindow(true);
}
//Make sure we start at the beginning of the file
UltraEdit.activeDocument.top();
// prompt for the search value
findStr = UltraEdit.getString("Please Enter a Product ID",1);
UltraEdit.outputWindow.write("");
UltraEdit.outputWindow.write("--- Search String ---");
UltraEdit.outputWindow.write("You searched for \"" + findStr + "\"");
UltraEdit.outputWindow.write("");
UltraEdit.outputWindow.write("--- Line Numbers ---");
UltraEdit.activeDocument.findReplace.find(findStr);

//loop to end of file


while (!(UltraEdit.activeDocument.isEof())) {
if (UltraEdit.activeDocument.isFound()) {
//get the line number that findStr is found on
lineNum = UltraEdit.activeDocument.currentLineNum;
//store line in array entry, but without line termination
UltraEdit.activeDocument.key("HOME");
/* If configuration setting >Home Key Always Goto Column 1<
is not enabled, the cursor could be not at start of the
line, if the line starts with spaces or tabs. */
if (UltraEdit.activeDocument.isColNumGt(1)) {
UltraEdit.activeDocument.key("HOME");
}
UltraEdit.activeDocument.startSelect();
UltraEdit.activeDocument.key("END");
ordersArr[x]= UltraEdit.activeDocument.selection;
UltraEdit.activeDocument.endSelect();
//output the line findStr is on
UltraEdit.outputWindow.write("Found \"" + findStr + "\" on line: " + lineNum);
//increment count
++x;
} else {
UltraEdit.activeDocument.bottom();
break;
}
UltraEdit.activeDocument.findReplace.find(findStr);
}
UltraEdit.outputWindow.write("");
UltraEdit.outputWindow.write("--- Total Orders ---");
UltraEdit.outputWindow.write("Total for \"" + findStr + "\" is: " + x );
UltraEdit.outputWindow.write("");
UltraEdit.outputWindow.write("--- Order Data ---");
//Output values in array
for (var i = 0; i < ordersArr.length; i++) {
UltraEdit.outputWindow.write(ordersArr[i]);
}
UltraEdit.outputWindow.write("");
UltraEdit.outputWindow.write("");
//copy contents of output window
UltraEdit.outputWindow.copy();

For our example, we will run the sample script against the "csv" file (below) searching for product ID "PRD-001".
If you need help adding a script to the scripts dialog, and executing it, please click here to view the introduction to scripting Power Tip.
OrderExport1.csv
First,Last,Address,City,State,Zip,Qty,Product
John,Doe,120 Jefferson St.,Riverside,NJ,08075,3,PRD-001
Mike,Pennington,123 Hickory Lane,Fairfield,OH,45014,1,PRD-002
John,Boyd,1234 East Main St.,Tau,NJ,08076,10,PRD-002
Raymond,Boltz,5555 Miami Ave,Wauneke,SD,92341,5,PRD-001
Michael,Blankman,786 Orlando Dr.,SomeTown,SD,00298,1,PRD-002
Michael,Smith,98989 W Washington Circle,Chicago,IL,86790,2,PRD-001

After you have added the script to the scripts dialog, click on the scripting menu and execute the ProductReport.js.

When prompted by the Data Input, type in the product ID number. The number we are using for our example is PRD-001.

After the script has executed, you will see the "report" generated in the output window. Furthermore, if you open a new edit window and
PASTE (CTRL + V), you will see the contents of the output window was pasted into the new edit window.

Writing a powerful macro


The easiest way to write a macro is not to write it from scratch but to let UltraEdit do most of the work for you. One of UltraEdit's
trademark features is the ability to use powerful macros.
The macro menu includes a feature called quick record which can write most of your macro for you if you understand how it works. The
quick record function records what you are doing until you tell it to stop.
When writing a macro, using quickrecord, the idea is to manipulate the text/data as much as possible using the keyboard, UltraEdit's
native functions, Templates, and even other macros so quickrecord can record your steps. After you stop quickrecord, you can then go
back and edit the macro by hand.
For instance, you can go back through your macros and add loops, conditional statments, regular expressions, etc.
We have used this method MANY times in creating very complex macros which have saved us hours and hours of work. It's just another
example of the power of UltraEdit!
Lets begin...

Writing a Macro
For the following example, we will take a pipe delimited data file (containing mailing addresses) and format the addresses into a standard
format. Furthermore, we want the macro to run through the entire file, formatting each record.
The sample file which we are using looks like this:

We understand that this may not be the exact macro you are looking to create, but pay attention to the methods used to create your own
macro.

1. Assess the 'problem'


Open the data file and first think through what you are starting with and what you need to end up with.
It's easiest to take a single record and determine what needs to be done with it, and worry about repeating the macro later.
For my example, this is what we are starting with:
Kevin Smith|109 Red Oak Dr.|Waukesha|WI|53189|USA
and this is what we would like to end up:

Kevin Smith
109 Red Oak Dr.
Waukesha, WI 53189
USA

2. 'Dry run'
Step through how you will format the data using only the keyboard.
Keep in mind, if you are planning on using loops (covered later) you will want to think through how you are incrementing to satisfy the
loop condition.
You don't necessarily need to do this, but I try to run through the steps one time before using the quick record to make sure I know how
to get the results I need.

3. Quick Record
Go to Macro : Quick Record (CTRL SHIFT R)

4. Step through formatting your data as desired


For the above example, I did a Find on '|'. This placed my cursor at the pipe symbol every time I hit F3 (or Find Next).

Then, I hit ENTER, SPACEBAR, and ',' where appropriate to format the data as needed and ended with this:

5. Stop Quick Record


Now that the single record is formatted as desired, stop quick recording in the Macro menu.

6. Edit the macro


To edit the macro you've recorded, go to Macro : Edit Macro. You will then see the Edit/Create Macro dialog.

Modify the Macro properties


I like to start by naming the macro, and assigning it a Hot Key. Click on the "Modify" button on the edit macro dialog.
The "Modify Macro" dialog will open and allow you to rename the macro and assign a Hot Key:

Editing the macro


Depending on what you want the macro to do, there are many functions listed in the command section. You can move them over using
the arrow or type them in by hand. For further information regarding the functionality of the commands available please see the help.

You will do your editing, as you may have guessed, in the text area:

For my example, I want to run through the entire file and format each record. This is known as a loop.
Loop the macro
This is where some programming experience comes in handy as you can add loops, conditional statements, etc. Loops and conditional
statements are not covered in the scope of this powertip as it assumes some prior knowledge of this.
Keep in mind, not every macro will require loops; however for my example I will use a loop to run through all of the data until the end of
the file.
The idea of the loop is to continue doing some action(s) until a condition is satisfied, at which point the loop will stop. When using a
loop, you MUST ensure that the condition will be satisfied in order to stop the loop, otherwise the loop will run indefinitely.
For our example the loop condition to be satisfied is the end of the file. The basic logic of the loop is: 'if the cursor is at the end of the
file, exit the loop; otherwise, keep running these steps'. ie:
Loop
IfEof
ExitMacro
Else
Action(s)
EndLoop
When recording my keyboard actions, after running through all of my formatting, I intentionally placed the cursor at the begginning of
the next line. I am therefore 'incrementing' the position of the cursor so with each loop, I am moving the cursor towards the end of the
file. If I didn't do this, the loop would spin indefinitely on the first record creating an 'infinite loop'.
Now, where to place the loop to do the appropriate actions. In the edit macro dialog, my macro looks like this:

ColumnModeOff
HexOff
UnixReOn
StartSelect
Find "|"
"
"
Find "|"
"
"
Find "|"
EndSelect
", "
StartSelect
Find "|"
" "
Find "|"
"
"
EndSelect
Key END
"
"
Key DOWN ARROW

The main action I want accomplished is everything below "StartSelect". So I edited my macro to look like this:
ColumnModeOff
HexOff
UnixReOn
StartSelect
Loop
IfEof
ExitMacro
Else
Find "|"
"
"
Find "|"
"
"
Find "|"
EndSelect
", "
StartSelect
Find "|"
" "
Find "|"
"
"
EndSelect
Key END
"
"
Key DOWN ARROW
EndIf
EndLoop

To help you understand where the loop/conditional statements flow, please see the following:

7. Save macro
To save the macro you have created you can either switch to a different Macro (in the drop down) or close the macro. You will then be
prompted to update the macro. Answer 'yes'. This will update the macro and then return you to the edit window.
You can save now save the macro (for later use) by going to Macro : Save All.

8. Play the macro


Finally, to play the macro, go to Macro : Play Any Multiple Times.
Take a look at the result of running the macro:

Please note, it is always a good idea to first test the macro on sample data, to ensure it is performing as you intend it to.
Have fun writing macros!