Macros|Record Macro

(available in EditPad Pro only)

To record a macro, select the Record Macro item in the Macros menu. EditPad Pro will ask you to enter a name for the macro. When you confirm the macro's properties, recording begins immediately.

When you're done recording the macro, select the Stop Recording item in the Macros menu. You'll notice it's the only available command during recording. You cannot play back and record macros at the same time.

To play back a macro, simply select it from the Macros menu or press its keyboard shortcut. The macro will be executed once. Select Organize Macros in the Macros menu if you want to run a macro multiple times.

EditPad Pro automatically saves macros. You won't be prompted for a file name. If you want to save a macro into a file so you can share it with other people, use the Export command in the Organize Macros screen.

How EditPad Pro Records Macros

Before you start recording and playing back macros, it's important that you understand exactly what EditPad Pro records. If you understand macros, they're a powerful and quick way to automate otherwise tedious and repetitive editing tasks. If you don't understand macros, they're a quick way to completely mess up your files.

Mouse Clicks Are Not Recorded

Clicks are relative to the position and size of EditPad's windows, to the location where you've scrolled, etc. A click at a certain position on the screen may have a totally different meaning from one situation to the next. Therefore, mouse clicks are not recorded. If you move the mouse over the text editing area, the mouse pointer will indicate you can't click. If you try, the click will have no effect at all.

Menu item commands and button commands are recorded. You can invoke them with the mouse while recording a macro. EditPad Pro will record the command that you clicked on, rather than the click itself.

Only Your Actual Actions Are Recorded

EditPad Pro only records exactly those keystrokes that you type, or exactly those commands that you invoke when running a macro. E.g. if you select the Search|Find Next menu item while recording a macro, the macro only records that you selected Search|Find Next. It does not record the search term, the search options, etc. If you play back the macro, it will simply execute Search|Find Next again. If you've changed the search term or search options since recording the macro, the new term and options will be used for the search.

By recording only your actual actions, you can make generic macros. E.g. if you want a macro that deletes every line with a search match, you can record Search|Find Next and Edit|Delete Line. You can then use that macro to delete the matches of any search term. Simply enter the correct search term before running the macro.

This also applies to any keystrokes you type into the editor, search box or replace box. The macro will record the actual keystrokes. Their effect may be different when you run the macro, depending on the position of the text cursor and if any text was selected. Keep this in mind when recording macros. You may want to press a few extra keys to make sure the macro works well. E.g. instead of requiring a macro to have the cursor at the start of the line, simply press the Home key when you start recording the macro. Even if the cursor was already at the start of the line when you recorded the macro, it will still record that you pressed the Home key.

How to Record Search Terms

If you want to record search terms as part of a macro, you can do so by selecting the search term from the Search|History or Search|Favorites menu. The macro will then record the search text, replace text and all search options. You can temporarily add a search term to the favorites before recording the macro. The macro will store the actual search terms, not the fact that you selected an item from the history or favorites. If you later delete the item from the history or favorites, the macro will still work.

Macros Record Command Options

Some commands in the Extra menu, like Delete Duplicate Lines and Compare Files show a screen with options before doing their work. If you use these commands while recording, the macro will record the state of the options screen when you click the OK button. It will not record whether you toggled any options, but the final result. When you play back the macro, the command will be executed with those options every time, without showing the options screen.

This rule may seem to contradict the "only your actual actions are recorded" rule. However, there's a key difference between the search options and the alphabetic sort options. You can set the search options in EditPad Pro's main window. If you toggle a search option, the option's state is recorded. Therefore, you can "prepare" the search options before playing back a macro that didn't record them. You could even record a macro that does nothing but set search options.

The Delete Duplicate Lines command's options can only be set when you've already told EditPad Pro to delete duplicate lines. You can't prepare the options prior to executing the macro.

The state of options that you can prepare are not recorded by macros, since actions that change the state of options that you can prepare are recorded. Commands with options that you cannot prepare record the state of the options as part of the command.

Failed and Inconsequential Commands Are Recorded

Pressing the Home key on the keyboard while the text cursor is already at the start of the line does nothing. However, macros still record that inconsequential key press. When the macro is played back, it will move the cursor to the start of the line if it isn't there already.

Search commands are special in EditPad Pro. They can fail. If you click the Find Next button and it flashes, that means it failed. There was no next search match. While recording a macro, the Find Next command is still recorded.

Failed Commands Halt Macro Playback

Though not exactly a recording issue, it's important to remember that if a search command fails during macro playback, it will stop the macro immediately. This allows you to run macros that run until failure to process all search terms.