How to Respond & Remove Text Between Markers in EmEditor - Advanced Editing Guide

How to Respond & Remove Text Between Markers in EmEditor - Advanced Editing Guide

Robert Lv8

How to Respond & Remove Text Between Markers in EmEditor - Advanced Editing Guide

November 14, 2006 at 7:41 pm #4006

Yutaka Emura

Keymaster

You can use the following macros (JavaScript):

// Delete lines between bookmarks  

bSuccess = false;  

if(document.selection.NextBookmark()){  

    y1 = document.selection.GetActivePointY(eePosLogical);  

    if(document.selection.NextBookmark()){  

        y2 = document.selection.GetActivePointY(eePosLogical);  

        document.selection.SetActivePoint(eePosLogical, 1, y1, false);  

        document.selection.SetActivePoint(eePosLogical, 1, y2, true);  

        document.selection.Delete(1);  

        bSuccess = true;  

if(!bSuccess){  

    alert("Cannot find bookmarks. The cursor position must be above both bookmarks before you run this macro.")  

  

// Copy lines between bookmarks  

bSuccess = false;  

if(document.selection.NextBookmark()){  

    y1 = document.selection.GetActivePointY(eePosLogical);  

    if(document.selection.NextBookmark()){  

        y2 = document.selection.GetActivePointY(eePosLogical);  

        document.selection.SetActivePoint(eePosLogical, 1, y1, false);  

        document.selection.SetActivePoint(eePosLogical, 1, y2, true);  

        document.selection.Copy(eeCopyUnicode);  

        bSuccess = true;  

if(!bSuccess){  

    alert("Cannot find bookmarks. The cursor position must be above both bookmarks before you run this macro.")  

  

// Cut lines between bookmarks  

bSuccess = false;  

if(document.selection.NextBookmark()){  

    y1 = document.selection.GetActivePointY(eePosLogical);  

    if(document.selection.NextBookmark()){  

        y2 = document.selection.GetActivePointY(eePosLogical);  

        document.selection.SetActivePoint(eePosLogical, 1, y1, false);  

        document.selection.SetActivePoint(eePosLogical, 1, y2, true);  

        document.selection.Cut();  

        bSuccess = true;  

if(!bSuccess){  

    alert("Cannot find bookmarks. The cursor position must be above both bookmarks before you run this macro.")

Also read:

https://techidaily.com
  • Title: How to Respond & Remove Text Between Markers in EmEditor - Advanced Editing Guide
  • Author: Robert
  • Created at : 2024-10-07 16:01:14
  • Updated at : 2024-10-14 16:14:15
  • Link: https://win-superb.techidaily.com/how-to-respond-and-remove-text-between-markers-in-emeditor-advanced-editing-guide/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
How to Respond & Remove Text Between Markers in EmEditor - Advanced Editing Guide