how to auto select and copy filtered results in emeditor

153 views Asked by At

presently em editor filter toolbar is having all options except option of auto selecting and copying filtered results to clipboard. manually i have to select and copy the filtered results. i need help on two issues.

  1. filter results to be automatically copied to clipboard. can you add option of auto select and copy filter results ?

  2. the following code to be appeneded to the above macro code. editor.ExecuteCommandByID(4445); WshShell = new ActiveXObject( "WScript.Shell" );

WshShell.Run ( "PotPlayerMini64.exe /clipboard" );

please help me.

1

There are 1 answers

4
Yutaka On BEST ANSWER

Here is a macro snippet to select all the text in the editor (after filtered), and copy the selection to the Clipboard, followed by your code. You will run this macro after you filter a document.

document.selection.SelectAll();  // Select All
document.selection.Copy(eeCopyUnicode);  // Copy the selection to the Clipboard
WshShell = new ActiveXObject( "WScript.Shell" );  // your macro
WshShell.Run ( "PotPlayerMini64.exe /clipboard" );

If you want to include filter in your macro, you can use this:

strFilter = prompt( "Filter:", "" );  // Prompt for a string
document.Filter( strFilter, 0, 0 );  // Filter (case-insensitive)
document.selection.SelectAll();  // Select All
document.selection.Copy(eeCopyUnicode);  // Copy the selection to the Clipboard
WshShell = new ActiveXObject( "WScript.Shell" );  // your macro
WshShell.Run ( "PotPlayerMini64.exe /clipboard" );