Skip to main content
Rebind runs on Windows and macOS, and the same scripts move between them. Core scripting (input events, binds, output, timers, files, network, and UI) works on both; this page lists what differs.

System requirements

  • Windows: Windows 10 or 11, 64-bit.
  • macOS: macOS 13 or later on Apple Silicon. Intel Macs are not supported.
The download page has the install command for each.

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.app names apps by executable (chrome or chrome.exe). activate focuses a visible window of a running app and never launches one; start apps with rb.system.exec_detached. quit closes the app’s windows, so an app with a tray icon may keep running; it raises when the app runs with no visible window. hide and is_hidden raise.

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, and rb.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.
  • activate brings 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.
  • move moves the frontmost app’s focused window. The handle is ignored.
  • activate and move go through the Accessibility API and need Accessibility, the same grant software mode needs.
  • get_title, get_pos, and get_pid read a window that is on screen and raise no window found for any other handle. is_visible is true only for a window on screen: not minimized, not hidden, and in the current Space.
Every other 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 an rb.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 the platforms 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:
Continue with the Scripting Guide.