问题描述
目前,em编辑器过滤器工具栏具有除自动选择并将过滤的结果复制到剪贴板外的所有选项。手动我必须选择并复制过滤的结果。 我需要解决两个问题。
-
过滤器结果自动复制到剪贴板。您可以添加自动选择的选项并复制过滤器结果吗 ?
-
以下代码将附加到上面的宏代码中。 editor.ExecuteCommandByID(4445); WshShell = new ActiveXObject(“ WScript.Shell”);
WshShell.Run(“ PotPlayerMini64.exe / clipboard”);
请帮助我。
解决方法
这是一个宏代码段,用于选择编辑器中的所有文本(过滤后),然后将所选内容复制到剪贴板,然后是您的代码。过滤文档后,您将运行此宏。
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" );
如果要在宏中包含过滤器,可以使用以下方法:
strFilter = prompt( "Filter:","" ); // Prompt for a string
document.Filter( strFilter,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" );