从外部 windows potplayer 应用程序抓取 emeditor 中的文本

grab text in emeditor from external windows potplayer application

我可以使用 control+a 然后使用 control+alt+c 命令从 potplayer 播放列表复制完整的播放列表和路径。 potplayer 可在以下地址获得

C:\Program Files (x86)\The Kmplayer\PotPlayerMini64.exe.

是否可以从emeditor宏代码中抓取上述播放器的文本?是否可以将消息发送到外部 windows 并从那里将文本复制到 emeditor?

我不确定你用的是什么potplayer。但是,如果您知道要发送 Ctrl+A 的 window 的 window 标题或 class 名称Ctrl+Alt+C 键,你可以写类似的代码这个:

wnd = shell.FindWindow( "", "potplayer window title" );
wnd.SetForeground();
shell.SendKeys( "^a" );
Sleep( 100 );
shell.SendKeys( "^%c" );

如果您不知道 window 标题或 class 名称,但 运行 指定应用程序路径“C:\Program Files (x86)\The Kmplayer\PotPlayerMini64.exe" 激活 window,你可以 运行 这个:

WshShell = new ActiveXObject( "WScript.Shell" );
WshShell.Run( "C:\Program Files (x86)\The Kmplayer\PotPlayerMini64.exe" );
Sleep( 1000 );
shell.SendKeys( "^a" );
Sleep( 100 );
shell.SendKeys( "^%c" );

参考文献