Ultimate Text Editing with EmEditor: Your Go-To Software Tool

Ultimate Text Editing with EmEditor: Your Go-To Software Tool

Scott Lv8

Ultimate Text Editing with EmEditor: Your Go-To Software Tool

July 30, 2014 at 10:55 am #18708

Stefan

Participant

Oh, you was faster than I?

I have just this moment worked on this too :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//JavaScript Macro for EmEditor, v0.01 by Stefan
//Purpose: Ensure that last line is a blank one, by adding one if need.

//EmEditor Help - EmEditor Macro Reference - Document Object
//Retrieves the number of the lines in the document:
nLines = document.GetLines();

//Retrieves the text on the specified line:
str = document.GetLine(nLines);

if(str.length != 0){
//If last line is NOT empty, add one blank line:
document.selection.EndOfDocument();
document.selection.NewLine();

//Workaround: Delete automatically added indenting from line above,//
//if line was not empty but indented by white space//
//Selects a line at the cursor:
document.selection.SelectLine();
//Deletes the selected text:
document.selection.Delete();

Also read:

https://techidaily.com
  • Title: Ultimate Text Editing with EmEditor: Your Go-To Software Tool
  • Author: Scott
  • Created at : 2024-10-10 16:42:20
  • Updated at : 2024-10-17 16:34:30
  • Link: https://win-top.techidaily.com/ultimate-text-editing-with-emeditor-your-go-to-software-tool/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Ultimate Text Editing with EmEditor: Your Go-To Software Tool