System requirements
- Windows: Windows 10 or 11, 64-bit.
- macOS: macOS 13 or later on Apple Silicon. Intel Macs are not supported.
Platform support
A call a platform does not support raises an error rather than returning a
made-up value, except where this page says otherwise.
Software and hardware mode run the same scripts and do not change this table,
except for media and volume keys on macOS; see How it
Works for what
depends on the mode.
Windows
rb.appnames apps by executable (chromeorchrome.exe).activatefocuses a visible window of a running app and never launches one; start apps withrb.system.exec_detached.quitcloses the app’s windows, so an app with a tray icon may keep running; it raises when the app runs with no visible window.hideandis_hiddenraise.
macOS
Software mode needs the Accessibility permission for Rebind. Rebind asks for it and restarts once you grant it.macOS screen capture
Screen reads are off until you turn on Screen capture under Screen access in Settings. Rebind then asks macOS for the Screen Recording permission and restarts once it is granted. Turning the setting on or off applies at once, without a restart, so running scripts keep running. Rebind captures the screen only while something reads it: a script reading pixels, a screenshot, or an observation. It stops two seconds after the last read, once no observation is running. While the setting is off, pixel reads, captures, image searches, andrb.ai
calls that take a picture raise “Screen capture is disabled. Enable it in
Settings.” While it is on without the permission, Settings shows a notice with
Open System Settings, and reads raise “macOS Screen Recording is off for
Rebind. Allow it in System Settings > Privacy & Security, or use Open
System Settings under Screen capture in Rebind’s Settings.” A permission you
revoke while Rebind runs takes effect at its next restart.
On macOS, window titles from rb.window and rb.system.window need the
Screen Recording permission; without it, titles are empty and no error is
raised. Turning on Screen capture in Settings is how Rebind asks for it.
rb.window on macOS
These work:find, list, from_point, get_foreground, get_title,
get_pos, get_pid, is_visible, activate, move, kill, is_active,
wait, wait_active, and wait_close.
activatebrings the window’s app to the front and raises that window, or the app’s focused window when it cannot match one. A window on another Space has no handle.movemoves the frontmost app’s focused window. The handle is ignored.activateandmovego through the Accessibility API and need Accessibility, the same grant software mode needs.get_title,get_pos, andget_pidread a window that is on screen and raiseno window foundfor any other handle.is_visibleistrueonly for a window on screen: not minimized, not hidden, and in the current Space.
rb.window call raises: get_class, get_state, minimize,
maximize, restore, close, hide, show, set_title,
set_always_on_top, and set_transparency.
rb.app on macOS
Apps are named by display name or bundle name, ignoring case.activate
brings a running app to the front and needs Accessibility. It never
launches an app; start one with rb.system.exec_detached. quit leaves an
app that is not running alone and asks macOS for the Automation
permission on first use.
rb.dialog on macOS
A native dialog needs a main run loop, which the Rebind relay does not run, so anrb.dialog call on macOS raises Dialog.Message() is not supported on macOS,
with the call’s name. Ask for confirmation another
way, such as osascript through rb.system.exec.
Media keys on macOS
In software mode, play or pause, next, previous, volume up, volume down, and mute are sent as system media events.MediaStop and F21 to F24 have no
macOS equivalent there.
Writing portable scripts
A script that supports only some platforms can say so with theplatforms
modeline key or [runtime] platforms in rebind.toml. Rebind refuses to load
it elsewhere, with a message naming the declared list. rb.info.platform
reports the host OS for code that branches instead.
To keep a call that only some platforms support, guard it with pcall: