Skip to content

Instantly share code, notes, and snippets.

@sago35
Last active December 19, 2022 12:39
Show Gist options
  • Save sago35/55960dd7af33158b96df9c76816983a2 to your computer and use it in GitHub Desktop.
Save sago35/55960dd7af33158b96df9c76816983a2 to your computer and use it in GitHub Desktop.
AutoHotkey を使って Adbe Acrobat Reader DC からのコピーの改行を翻訳用に調整する
;#IfWinActive Adobe Acrobat Reader DC
#IfWinActive Adobe Acrobat Reader (64-bit)
^c::
Send, ^c
ClipWait
x = %clipboard%
space := " "
StringReplace, x, x, .`r`n, .`r, All
StringReplace, x, x, :`r`n, :`r, All
StringReplace, x, x, `r`n, %space%, All
StringReplace, x, x, .`r, .`r`n`r`n, All
StringReplace, x, x, :`r, :`r`n`r`n, All
clipboard = %x%
return
#IfWinActive
@sago35
Copy link
Author

sago35 commented Feb 26, 2022

Beat transfer: The size of one data transfer bus access, and the size is selected by writing the Beat Size bit
group in the Block Transfer Control register (BTCTRL.BEATSIZE)

のように Beat Size bit の後に改行があるため DeepL 等で翻訳しにくい。
DeepL の場合、上記の文章は例えば以下のように翻訳される。

ビート転送。データ転送バスアクセス1回分のサイズで、ビートサイズビットの書き込みで選択します。
ブロック転送制御レジスタ(BTCTRL.BEATSIZE)内のグループ

上記の AutoHotkey script を実行しているときは Ctrl-c を押した時に改行文字が調整され以下のようにコピーされる。

Beat transfer: The size of one data transfer bus access, and the size is selected by writing the Beat Size bitgroup in the Block Transfer Control register (BTCTRL.BEATSIZE)

これにより DeepL の翻訳結果は以下のようになる。

ビート転送。データ転送バスアクセス1回分のサイズで、ブロック転送制御レジスタ(BTCTRL.BEATSIZE)のビートサイズビットグループの書き込みにより選択される。

@sago35
Copy link
Author

sago35 commented Feb 26, 2022

@sago35
Copy link
Author

sago35 commented Feb 26, 2022

スペースの扱いが悪かったので少し修正した。
だいたい正しく動いているはず。

@sago35
Copy link
Author

sago35 commented Feb 26, 2022

: で終わる書き方の表示を調整。

@sago35
Copy link
Author

sago35 commented Dec 19, 2022

Window タイトルが変更になっているので追従。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment