0

目前 em 编辑器过滤器工具栏具有所有选项,除了自动选择和复制过滤结果到剪贴板的选项。我必须手动选择并复制过滤后的结果。我在两个问题上需要帮助。

  1. 过滤结果自动复制到剪贴板。您可以添加自动选择和复制过滤结果的选项吗?

  2. 将以下代码附加到上述宏代码中。editor.ExecuteCommandByID(4445); WshShell = new ActiveXObject("WScript.Shell");

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

请帮我。

4

1 回答 1

0

这是一个宏片段,用于选择编辑器中的所有文本(过滤后),然后将选择复制到剪贴板,然后是您的代码。您将在过滤文档后运行此宏。

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, 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" );
于 2020-09-27T16:19:21.547 回答