I have been using following code to replace formatting and new lines from PDF doc (FOXIT READER SPECIFICALLY). But with recent version of Foxit Reader, the code is not working anymore. <br/>
Now it does not replace formatting from PDF doc, nor it removes line breaks. I have tried to uninstall and re-instal older version of Foxit pdf reader. Strangely it works with old version but not newest (Version 12.1.0.15250). <br/>
This thing is very strange as text is copied to clipboard and is manipulated later. So version should not affect it. Following is the code. Any help will be highly appreciated. <br/>
Autohotkey Version: 1.1.36.02
<CODEBOX codebox="autohotkey" file="Untitled.ahk"><s>
Code: Select all
</s>#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;#singleInstance force
;follwing script removes line breaks when copying text from foxit pdf viewer. It also capitalises the first word in new sentence after dot.
F8::Pause
#persistent
OnClipboardChange:
If A_IsPaused
Return
sleep, 20
IfWinActive, ahk_class classFoxitReader
{
if DllCall("IsClipboardFormatAvailable", "uint", 1) ; check if clipboard has copied a text
{
StringReplace, Clipboard, Clipboard, `r`n,%A_Space%, All
StringReplace, Clipboard, Clipboard,-%A_Space%,, All
Clipboard := RegExReplace(Clipboard, "`am)^\s*\w|\si\s|\b(?:[A-Z]\.){2,}|[.?!]\s\w", "$U0") ;This works with acronyms as well and doesn't capitalize after acronyms
}
}
<e>