[瞎搞]讀PDF英文文獻時,剪切板中的回車用空格代替

更新,可以刪掉了,找到了這個https://github.com/gaoyaoxin/yPDF


英文垃圾如我,讀文章的時,最苦惱的莫過於複製了的問題會把結尾的換行符也複製進剪切板,影響翻譯質量。
各種搜索找了AutoHotKey。
在不影響Ctrl-c,Ctrl-v使用體驗的情況下,解決了身爲英文小白的苦惱。

#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.

;在pdf內換行替換爲空格,以方便pdf論文的翻譯。
#IfWinActive ahk_class AcrobatSDIWindow
^c::
    send, {ctrl down}c{ctrl up}  
    Sleep 100
    tmp := RegExReplace(clipboard, "(\S.*?)\R(.*?\S)", "$1 $2")
    clipboard := tmp
    ; StringReplace clipboard, clipboard, % " ", % "", A
    clipwait 0.1  
    return
#IfWinActive

;全局alt + g = google搜索網頁內容。
!g:: 
    Send ^c 
    sleep 10
    Run http://www.google.com/search?q=%clipboard% 
    return 

拜謝網上的各位大佬!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章