Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
- November 14, 2006 at 7:18 pm #4005muskokaParticipant
Is there a simple way to delete all lines between two boomarks? A function to cut and another for copy between bookmarks would also be useful.
November 14, 2006 at 7:41 pm #4006Yutaka EmuraKeymasterYou 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." )
}
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.