ExtractLinesMulti.jsee宏非常古老,我改用 EmEditor 的批量查找/提取功能重写了宏。这是提取包含任何指定多个字符串的行的宏,这些字符串由 分隔|
:
if( !editor.EnableTab ){
editor.EnableTab = true;
alert( "Please run this macro again." );
Quit();
}
sFind = prompt( "This macro extracts lines that do contain any of the specified multiple strings separated by |:", "" );
if( sFind == "" ){
Quit();
}
var sArr = sFind.split("|");
batch_list = editor.filters;
for( i = 0; i < sArr.length; ++i ) {
batch_list.AddFind(sArr[i],eeFindReplaceCase,0);
}
document.selection.BatchFind(batch_list, eeFindExtract | eeFindLineOnly,0);
document.selection.SelectAll(); // select all text
document.selection.Copy(eeCopyUnicode); // copy the seleciton to the Clipboard
您可以在此宏的末尾添加任何您想要的代码。
参考资料:http ://www.emeditor.org/en/macro_selection_batch_find.html