将文本复制到剪贴板并粘贴到Word中时,Adobe Acrobat中的长段落会导致换行。
为了解决这个问题,我手动将复制的文本粘贴到记事本++ > select all > ctrl+J (join lines) > select all > Copy......然后粘贴到我的Word文档中。
我想使用autohotkey自动执行这条连接线,因为我有大量的文档要处理。我似乎在网上找不到任何直接在autohotkey脚本中处理这个问题的例子。
例如。
Data structures with labeled axes supporting automatic or explicit data alignment.
This prevents common errors resulting from misaligned data and working with
differently-indexed data coming from different sources.手动加入记事本++后
Data structures with labeled axes supporting automatic or explicit data alignment. This prevents common errors resulting from misaligned data and working with differently-indexed data coming from different sources.发布于 2020-08-14 21:02:38
考虑到以连字符结尾的行,我添加了功能。
之前:
This occurs in elec-
tricity generation
systems.之后:
This occurs in electricity generation systems.代码:
#Persistent
return
OnClipboardChange:
If WinActive("ahk_exe AcroRd32.exe")
{
clipboard := ""
Send, {Ctrl down}c{Ctrl up}{Esc}
ClipWait
clip := RegExReplace(clipboard, "(\S.*?)-\R(.*?\S)", "$1$2") ; strip line breaks with hyphen
clip := RegExReplace(clip, "(\S.*?)\R(.*?\S)", "$1 $2") ; strip line breaks and replace them with spaces
StringReplace clip, clip, % " ", % " ", A ; replace double spaces with single spaces
clipboard := ""
clipboard = %clip%
ClipWait 2
If !(ErrorLevel)
{
ToolTip, lines joined
Sleep 500
ToolTip
}
}
returnhttps://stackoverflow.com/questions/43169213
复制相似问题