開発を行っているときやブラウザで何かを読んでいるとき、ChatGPTにコピペして質問することがよくあります。
When developing or reading something in a browser, I often copy and paste text into ChatGPT to ask questions.
その手間が面倒なので、選択範囲をすぐGPTに送れるようにしてみました。
Finding this cumbersome, I created a way to instantly send selected text to GPT.
前提としてChatGPTの公式アプリのインストールが必要です。
This requires installing the official ChatGPT app.
以下をコピー
Copy the following:
#Requires AutoHotkey v2.0
; ────────────────────────────────────────────────
; Hotkey: Ctrl + Shift + q
; Step 1 : コピー
; Step 2 : ChatGPT デスクトップ アプリのクイックバー呼び出し
; Step 3 : ペーストして送信
; ────────────────────────────────────────────────
^+q:: {
ClipSaved := ClipboardAll() ; 既存クリップボードを退避
Send "^c" ; 選択テキストをコピー
ClipWait 0.5 ; コピー完了待ち
Send "^+g" ; ChatGPT アプリのオーバーレイを開く :contentReference[oaicite:0]{index=0}
Sleep 500 ; ウインドウが出るまで 0.5 秒ほど待機
Send "^v" ; 貼り付け
Clipboard := ClipSaved ; クリップボードを元に戻す
}
returnAutoHotkey v2 をインストールして起動
https://www.autohotkey.com → Download → v2 Installer を選択。インストール後起動。
Install and launch AutoHotkey v2: https://www.autohotkey.com → Download → Select v2 Installer. Launch after installation.
上記コードを send_to_chatgpt.ahk などのファイルに保存。
Save the above code to a file, such as send_to_chatgpt.ahk.
ダブルクリックして常駐。
Double-click to run in the background.
自動起動したい場合は shell:startup フォルダにショートカットを置く。
For automatic startup, place a shortcut in the shell:startup folder.
ChatGPT アプリのショートカット変更(デフォルトだと他アプリのショートカットとぶつかるため)
ChatGPT → Settings → App → Hot KeyでShift+ctrl+gに変更する。
Change the ChatGPT app shortcut (this is to avoid conflicts with other app shortcuts). ChatGPT → Settings → App → Change the Hot Key to Shift+ctrl+g.
これでどこにいてもShift+ctrl+qを押せばすぐChatGPTに送れます。
Now, pressing Shift+ctrl+g will instantly send text to ChatGPT, from anywhere.
貼付けされないときはsleepを1000くらいにしてみてください。
If pasting doesn't work, try increasing the sleep value to around 1000.