如何解决如何在emeditor中自动选择和复制过滤结果
目前,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" );
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。