AutoHotkey + Capture2Text: Remap Keys & Automate OCR

First, the Honest Bit: No Official Integration

Capture2Text ships no AutoHotkey plugin, no AHK library, and no scripting API. Everything in this guide uses documented, real features — hotkey remapping, the command-line interface, and the “Call Executable” output hook — combined with ordinary AutoHotkey. Nothing here pretends to be an official integration.

Method 1 — Remap, Then Send the Hotkey

The simplest automation: let AHK press Capture2Text’s hotkey for you.

  1. In Capture2Text, open Settings → Hotkeys and note (or remap) the standard capture hotkey — default Win+Q. See our hotkey customization guide.
  2. In your AHK script, send that hotkey from your own trigger:
; AHK v1: press F1 to start a standard OCR capture
F1::Send #q

; AHK v1: press F2 for an instant text-line capture (Win+E)
F2::Send #e

AHK v2 equivalent: F1::Send "#q". This keeps Capture2Text’s own capture UI (blue box, popup) while giving you whatever trigger key you want — foot pedals, mouse buttons (XButton1), or combos Capture2Text’s own Hotkeys tab cannot express.

Method 2 — Drive the CLI from a Script

For fully hands-free OCR with no capture box, call Capture2Text_CLI.exe directly (full reference: CLI manual):

; AHK v1: F3 OCRs a fixed screen region straight to the clipboard
F3::
    RunWait, "C:\Tools\Capture2Text\Capture2Text_CLI.exe" --screen-rect "400 200 900 400" --clipboard -l English,, Hide
    MsgBox, Captured: %Clipboard%
return

Use -o result.txt --output-file-append instead of --clipboard to build a log file of captures over time.

Method 3 — “Call Executable”: Capture2Text Calls Your Script

The reverse direction is built into Capture2Text: Settings → Output → Call Executable runs any program after each OCR capture, with tokens you can use:

  • ${capture} — the OCR’d text
  • ${translation} — the translated text (if translation is enabled)
  • ${timestamp} — when the capture happened

The official documentation’s own example calls a Python script: C:\Anaconda3\python.exe "C:\Scripts\test.py" "${capture}" "${translation}". Point it at an AHK-compiled exe or a Python script to auto-log captures, append them to a notes file, or trigger follow-up automation — e.g. instant dictionary lookup of every captured Japanese word.

Practical Ideas

  • One-key manga lookup: F1 sends Win+S (bubble capture); Call Executable pipes ${capture} to a dictionary script.
  • Timed captures: AHK’s SetTimer + CLI --screen-rect snapshots a changing region (game dialogue, live stats) every N seconds.
  • Portable rig: combine with Capture2Text.exe --portable and keep the AHK script in the same folder — see the portable guide.

New to scripting captures? Read the CLI manual first, then the hotkey reference. Browse all guides.

Frequently Asked Questions

Does Capture2Text have official AutoHotkey integration?

No — there is no official AHK plugin or API. But Capture2Text is very scriptable: remap its hotkeys to anything, drive the CLI (Capture2Text_CLI.exe) from scripts, or use the Call Executable feature to pipe OCR results into your own program.

How do I remap Capture2Text hotkeys with AutoHotkey?

Simplest: in Capture2Text Settings → Hotkeys, assign the capture action to a hotkey your script can press, then have AHK send it — e.g. F1::Send #q triggers the default Win+Q capture. AHK v2 uses Send “#q”.

Can AutoHotkey OCR the screen directly through Capture2Text?

Yes, via the CLI: RunWait, Capture2Text_CLI.exe –screen-rect “x1 y1 x2 y2” –clipboard -l English from your script, then read the clipboard. No GUI interaction needed.

What is “Call Executable” in Capture2Text settings?

An official Output-tab feature: after every OCR capture, Capture2Text runs a program you specify, passing variables like ${capture} (OCR text), ${translation}, and ${timestamp}. Example from the docs: call a Python script with the captured text as arguments — perfect for logging captures or feeding them to AHK-adjacent automation.

Can I make a “press F1 to OCR” script?

Yes: F1::Send #q (AHK v1) sends Win+Q, opening the standard capture box. For a fully hands-free version, bind F1 to the CLI with –screen-rect and –clipboard instead.

Is AutoHotkey safe to use alongside Capture2Text?

AutoHotkey itself is a well-known open-source automation tool. As with any scripting tool, download it from autohotkey.com and review scripts before running them — especially ones that send keystrokes.