#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." )
}