EmEditor Home - EmEditor Help - EmEditor Macro Reference - Tutorial

Convert Character in Selection Range

To convert characters in Selection Range, add the seventh line to our Tutorial macro:


document.selection.Text = "EmEditor supports macros.";
document.selection.Text = "\tEmEditor is a text editor.";
document.selection.CharLeft( false, 12 );
document.selection.DeleteLeft( 15 );
document.selection.CharRight( true, 9 );
document.selection.ChangeCase( eeCaseUpperCase );


document.selection.Text = "EmEditor supports macros."
document.selection.Text = Chr(9) & "EmEditor is a text editor."
document.selection.CharLeft False, 12
document.selection.DeleteLeft 15
document.selection.CharRight True, 9
document.selection.ChangeCase eeCaseUpperCase

Save the above macro and run it in a new EmEditor window. Notice that the characters of the selected text have converted to upper case:


ChangeCase Method takes an argument that specifies whether characters are to be converted to upper case or lower case.

Similarly, the following methods are provided to convert characters in Selection Range. For further details, such as explanations of arguments that methods take, refer to each method.

ChangeCase Convert characters to upper or lower case.
ChangeWidth Convert characters to half-width or full-width characters.
Format Insert a new line at a line wrap position of the selection range or delete a newline.
Indent Indent the section specified by the selection range.
Tabify Convert spaces to tabs in the selection range.
UnIndent Unindent the section specified by the selection range.
Untabify Convert tabs to spaces in the selection range.

Next Topic:

Find in Files

Copyright 2003-2016 by Emurasoft, Inc.