Keystroke Macro Language

A keystroke macro consists of one or more command lines.

Lines that are empty or that contain only spaces or tabs are ignored.

Lines that have a forward slash character (/) as the first non-blank character are ignored, and can be used for comments.

Each line contains a single command followed by an optional repeat count (an asterisk followed by a number); for example, the following command line moves the caret four characters to the right.

If the repeat count is zero (0), the command is not executed.

CharacterRight*4

Most commands equate to a single keystroke. Some commands are not bound to keystrokes, by default, and cannot be recorded (for example, TransposeLine).

Command names that end with Extend modify the current selection.

Some keystroke macro commands are listed in the following table.

Command Details
"quoted text" Text keystrokes. Double quote (") and backslash (\) characters are escaped from with a leading backslash; for example, "\"" and "\\" indicate one double quote and one single backslash character, respectively.
CopyToClipBuffer <bufferId> PasteFromClipBuffer <bufferId> The <bufferId> parameter defines which of the ten clip buffers to use and it must be a single digit in the range 0 through 9.
Find "<target>" <options> Searches for the next occurrence of the specified "<target>" parameter value, and if found, selects it.
  The <options> parameter can be one or more of the following values.
 
  • caseSensitive, for a case-sensitive search.

 
  • wholeWord, to exclude partial word matches.

 
  • wordStart, to match the target to the beginning of words.

 
  • unslash, regexpr, or posixRegexpr, to indicate that the target contains backslash escape characters, a regular expression, or a Posix regular expression. The default value is literal text.

 
  • backwards, to search back towards the start of the document. The default value is forward to the end of the document.

 
  • fromCaret or inSelection, to select the search start point. The default value is the whole document.

FindNext or FindPrior Searches for the next or prior occurrence of the current search target. The direction of these commands reverses if the Find command included the backwards option.
PasteDynamic name The name parameter is the name of the dynamic text element to insert. The JADE development environment supplies the className, date, date_ymd, methodName, patchNumber, schemaName, time_hms, timestamp, and userId dynamic elements.
Uppercase or Lowercase Changes the case of the selected text.
AddText "<text>" Inserts the specified text after the current position, which remains unchanged.
AppendText "<text>" Adds the specified text to the end of the existing text and moves the caret to the end of the new text and into view.
InsertText "<text>" Inserts the specified text before the current caret position and moves the caret to the end of the added text, but does not force it into view.
PasteText "<text>" Deletes the selection (if any) and then inserts the text specified in the "<text>" parameter at the caret, leaving the caret at the start of the text.
PushPosition Pushes the caret location onto a stack that holds 20 entries. When the stack is full, the oldest entry is discarded.
PopPosition Pops the top entry of the stack. If the stack was not empty, the caret is moved to that location.
ReplaceAll "<target>" "<new>" <options> Replaces all occurrences of the target text with the new text. The values for the <options> parameter are those of the Find "<target>" <options> command.
ReplaceFind "<new>" <options> Replaces the current find target with the new text and then searches for the next find target.
SelectWholeLines Extends the current selection so that the start is at the beginning of the first line of the selection and the end is at the end of the last line of the selection.
SpaceToColumn <column> Inserts whitespace to move the caret to the specified column. This command does nothing if the caret is already at or past the specified column.

In Find, ReplaceFind, and ReplaceAll commands <target> and <new> quoted text parameters, a backslash is used to escape the following characters.

A backslash followed by any other character is those two characters. These escape sequences are interpreted before regular expression processing begins.

In a find target regular expression, the special characters that are interpreted are listed in the following table.

Character Description
. Matches any character.
\( Marks the start of a region for tagging a match.
\) Marks the end of a tagged region.
\n The n parameter is a digit in the range 1 through 9, which refers to the first through ninth tagged region when replacing; for example, if the search string was Fred\([1-9]\)XXX and the replace string was Sam\1YYY, this would generate Sam2YYY when applied to Fred2XXX.
\< Matches the start of a word. A word is defined to be a character string beginning or ending, or both beginning and ending, with characters in the ranges A through Z, a through z, 0 through 9, and an underscore. In addition, it must be preceded or followed, or both preceded and followed, by any character outside those mentioned.
\> Matches the end of a word.
\x Enables you to use a character x that would otherwise have a special meaning; for example, \[ would be interpreted as [ and not as the start of a character set.
[...] Indicates a set of characters; for example, [abc] means any of the characters a, b, or c. You can also use ranges; for example, [a-z] for any lowercase character.
[^...] Complement of the characters in the set; for example, [^A-Za-z] means any character except an alphabetic character.
^ Matches the start of a line (unless used inside a set).
$ Matches the end of a line.
* Matches zero (0) or more times; for example, Sa*m matches Sm, Sam, Saam, Saaam, and so on.
+ Matches one or more times; for example, Sa+m matches Sam, Saam, Saaam, and so on.