Skip to content

Capture Text

ClicKey Pro

Capture Text uses OCR to read whatever text is visible inside a screen region you draw, and (optionally) stores the result in a text variable. Use it when a macro needs to know what’s on screen – an order number, a confirmation message, a balance – before deciding what to do next.

Capture Text reads the area you pick once. It’s a “look once and move on” action – it doesn’t poll or wait. If you need to wait for specific text to appear, use Find Text instead.

Capture Text needs Screen Recording permission to read pixels. Without it, the action fails immediately. See Permissions on macOS if you haven’t granted it.

  1. Click + Add Action → Capture Text.
  2. In Capture Area, pick what ClicKey should read (see Choosing where to look). For Fixed area, click Draw and drag the rectangle that contains the text.
  3. Click Test to run OCR once. The exact multi-line text ClicKey recognized appears below the button, so you can adjust the area or recognition settings before saving.
  4. Pick a text or number variable to save the recognized text into, and set what should happen when nothing usable is recognized (see Saving into a variable). This is optional – but without a variable, the text that was read is simply thrown away.
  5. Expand Advanced Text Recognition to choose a Language or leave Use General Setting selected, and select Focused on codes & numbers if you are reading an ID, serial number, or other exact character sequence.
  6. Save. The action runs once each time your macro reaches it.

The Capture Area section starts with a picker that decides which rectangle OCR reads:

TargetWhat it reads
Fixed areaA rectangle you set with X, Y, width, and height – or draw with Draw. The default.
Current MonitorThe whole monitor the mouse cursor is on when the action runs.
Specific MonitorA whole monitor you pick from the list, main display first.
WindowA window you pick from the list of open windows. The first entry, Current Window, means whatever window the macro is working in at that moment – the one the most recent Window Anchor resolved to, or the frontmost window when no anchor has run. Go to Window brings the selected window to the front, so you can see exactly which one it is.

Monitor and window targets are resolved fresh each time the action runs, so the macro follows a monitor or window that has moved. A Window target is also brought to the front first, so it isn’t covered by another window – and it stays in front afterwards.

To see the area during playback, enable Run Settings → Advanced → Highlight screen-reading areas.

OptionWhat it doesDefault
Capture AreaFixed area, Current Monitor, Specific Monitor, or Window (including Current Window) – see Choosing where to look.Fixed area
Area X / YThe top-left screen coordinate of the OCR area. Each field accepts a Number expression. Only shown for Fixed area.–
Area width / heightThe size of the OCR area. Each field accepts a Number expression and resolves to at least 1 point. Only shown for Fixed area.–
TestRuns the same one-time OCR used by playback and shows the recognized multi-line text.Optional
Save captured text toA text or number variable that receives the result. The dropdown shows each variable’s type. Optional.None (result is discarded)
Number formatOnly for a Number variable: how the text is read as a number – Automatic, 1,234.56, or 1.234,56.Automatic
If no text / number is recognizedKeep going, Stop playback, or Use a fallback value.Keep going
Test (Save Text to Variable)Captures the area again and shows exactly what would be stored – the text, or the converted number.Optional
LanguageIn Advanced Text Recognition: Use General Setting follows Settings → General → Default OCR Language dynamically. Automatic detects the language for this action.Use General Setting
Recognition StyleIn Advanced Text Recognition: Default uses language correction; Focused on codes & numbers avoids language-based correction or refinement for numbers, IDs, serial numbers, and product codes.Default

Text variable – the full recognized text is stored, exactly as OCR read it, including line breaks.

Number variable – the recognized text is read as a number, so you can calculate with it without a second action. Currency symbols, percent signs, and spaces are ignored, and a leading minus is kept. Number format decides which character separates the decimals.

OCR mistakes are never repaired: a letter O read instead of a zero makes the conversion fail rather than silently producing a wrong number.

If no text / number is recognized decides what happens when the area is empty or the text isn’t a number:

ChoiceWhat happens
Keep goingA text variable receives the empty text; a number variable keeps its current value. Playback continues.
Stop playbackPlayback stops with a message naming the action and what was recognized.
Use a fallback valueThe value you type is stored instead, and playback continues.

Use the Test button in this section to see the outcome before running the macro – it reports either the value that would be saved or why the conversion failed.

Area expressions are evaluated when the action runs. If an expression is invalid, references a missing variable, or does not resolve to a Number, playback stops before anything is read.

  • Test shows what playback would read. An area field holding an expression is tested with the variables’ default values – see Expressions in the editor.
  • Screen Recording permission is required. Without it the action fails and the macro stops with a permissions error at this step.
  • OCR is text recognition, not screenshot capture. If you want a saved image of the area, use Take Screenshot instead.
  • OCR works best on clear text. Stylized fonts, very small text, low contrast, or text inside an image or video can return imperfect results. Test your area before relying on it.
  • Empty results are valid. If the area contains no readable text, the saved variable becomes the empty string "" – not an error. Guard the next step with a conditional if that matters.
  • Multi-line text keeps its line breaks, in reading order – top to bottom, left to right. To take only the first line, post-process with Set Variable: "{captured}".split("\n")[0].
  • Non-Latin scripts work well for the major languages; handwriting is less reliable.
  • The action runs once – it doesn’t watch the area for changes. For “wait until text appears,” use Find Text.
  • Find Text – check for specific text, wait for it, and click on it or save it.
  • Variables and Expressions – what kinds of variables you can save into, and how to use them in later steps.
  • Set Variable – clean up or transform the captured text before using it.
  • Take Screenshot – save the area as an image instead of OCRing it.
  • Permissions on macOS – Screen Recording must be granted for this action to work.