OK, I've put together the following code: I make a selection of text in Acrobat Reader DC and then press F12. I then go to Notepad or MS Word and paste with ctrl-V.
Code: Select all
clipboard = ; clear the clipboard
Content := Clipboard
WinGetText, AllText, ahk_class AcrobatSDIWindow
WinGetTitle, FullTitle, ahk_class AcrobatSDIWindow
StringReplace, Title, FullTitle,%A_Space%- Adobe Acrobat Reader DC
;MsgBox % "File: " Title "`nPage: " page
clipboard := % "File: " Title " Page: " Page "`r`n" Content
The results are not consistant. I.e. Sometimes it works, sometimes nothing is copied to the clipboard and sometimes, the previous filename and pagenumber are appended to the top of the clipboard. Any tips on how to improve this script?