rb.ai lets a script ask a model about the screen: where something is
(rb.ai.find), what some text says (rb.ai.read), or which of several answers
fits (rb.ai.decide). Use it for things you can describe in words but cannot
pin down as a pixel color or an image.
Before you start:
- Rebind Pro.
rb.aiandrb.phoneare part of Rebind Pro. Calls go through the account signed in to Rebind, and the first call from an account without Pro starts its free trial. Each call’s cost counts against the monthly AI allowance, so call on a hotkey or a slow interval, never on every tick. - A coroutine. Each call waits for the model, so it must run inside
rb.runor a function wrapped inrb.async. Outside one, it raises an error. - The
aipermission. A script that declares permissions listsai, or only the calls it uses:ai:find,ai:read,ai:decide. That needsmin_sdk=3.9.0or later. See Permissions. - The screen.
findandreadalways send a screenshot, anddecidesends one when you passscreen = trueor awindow. Screen reads work on Windows and macOS; see Platforms.
Click something you describe
Press a hotkey and the script finds the button by its description, moves the cursor onto it, and clicks.rb.ai.find returns the centre of what you
described in screen coordinates, or nil when it is not on screen.
window option, find looks at the display under the cursor. Pass
{ window = "Title" } to look inside one window instead. Describe the target
the way you would to a person: its label, color, and where it sits.
Read a value off the screen
rb.ai.read returns the text you describe, exactly as it appears. When the text
is not on screen it returns an empty string, so check for "" before using
the result.
window names the window by title (on macOS, by title or app name), and the
call reads the pixels inside that window’s rectangle. If no window matches, the
call raises an error naming the title.
Read next to something you found
find and read combine: find a label, then read the value printed beside it.
The at option reads a small box centred on a point.
Wait for something to happen
rb.ai.decide picks one of the choices you give it and returns the model’s
confidence from 0 to 1. This script checks the screen once a minute and stops
when it is confident a long job has finished, then tells you.
screen = true or a window, decide answers from the question alone
and sends no screenshot. rb.phone.notify returns { delivered, reason }.
There is no phone app yet, so it always returns delivered = false with the
reason "no phone connected"; the script falls back to a notification in
Rebind.
Keep looks inside one app
A script targeted at an application can promise to read only that application’s window. Addscreen:target to its permissions along with a
process= or window= target. Then find and read without a window look
at the target window instead of the whole display, and Rebind’s install screen
shows the narrower grant.
screen:none blocks every look, so a script with it can still use decide
without a screenshot but not find or read. Scoped permissions are explained
in Permissions.