min_sdk, in its modeline or in its package’s rebind.toml. For a
package’s entry, rebind.toml wins; another script in the package keeps its own
modeline values (see
Package format). A
required module needs none.
This script is active only while Notepad is focused and its window title does
not contain Untitled. It needs no permissions, refuses a second start while it
runs, and prints a line each time it becomes active or inactive:
rebind: line per setting. The single-line form is
-- rebind: key=value key=value, and the third form, the inline block, is
--[[ rebind: ... ]]. Values end at the next space unless quoted with " or
'; inside quotes, escape the quote and backslash as \" and \\. A string key (name,
description, author, and the targeting keys) alone on its line takes the rest
of the line, so rebind: name=My Script needs no quotes. Repeatable keys may
repeat on one line or across lines. An unknown key is ignored, with a warning in
the script’s log and in rebind check.
Booleans accept
true, false, 1, 0, yes, no. include_window and
include_process are older spellings of window and process, and platform
of platforms. The id key is ignored with a warning.
Positive targeting rules combine with OR. With none, the script is active in
every window. A matching exclusion deactivates it even when a positive rule
matches. Regular expressions use Rust regex syntax; an invalid or empty one
stops the script from loading. A script with regex or exclusion targeting
should declare min_sdk=3.4.1 or later, so that a Rebind without these keys
refuses the script instead of ignoring its scope.
Permissions
A script with nopermission= line holds every permission except observe.
Once any line is present, only the listed permissions are granted:
permission=net alone also denies exec. permission= and permission=none declare that the script needs
nothing. Each non-empty line adds to the set, and a comma list adds several;
an empty value or none resets the set to empty. In a package,
permissions = [] in rebind.toml means the same.
The clipboard has no plain name: a list reaches it through the
clipboard:read and clipboard:write entries.
loadstring exists only for a script whose list includes exec, or one with no
permission line and a min_sdk below 3.9.0. Any other plain name grants nothing
but still switches the script to a list. A denied call raises when it runs, for
example Net.Get() requires 'net' permission. Add -- rebind: permission=net to your script., so a call in an untaken branch
never fails. Once a call is refused, Rebind stops the script, even when the
script catches the error with pcall, and shows a notice naming what it was not
allowed to do. rb.file, rb.registry, rb.process, rb.env apart from
rb.env.set, rb.input, rb.hid and rb.macro have no permission check;
rb.file paths stay inside the script directory and its data folder regardless. Ending programs
needs no permission (rb.process.kill, rb.app.quit, rb.window.kill), and a
value written under a Windows Run key with rb.registry starts a program at the
next sign-in.
Reasons and approval
The install screen lists what a script can do and shows the author’s reason beside each sensitive item. A marketplace package must give a reason forexec,
for net or any net: entry, for screen or screen:target, and for
observe: permission_reason="net: Posts your scores" in a modeline, or
permission_reasons = ["net: Posts your scores"] under [runtime].
rebind check refuses a package with a [marketplace] block that leaves one
out.
A script installed from the marketplace or a share loads only while its
permissions and targets stay within what you approved. An update or edit that
asks for more, or targets something else, waits for your approval. net covers
every net: entry, ai every ai: entry, and screen covers
screen:target. Nothing else covers observe.
Scoped permissions
Needs:min_sdk=3.8.0.
A family:scope entry grants one part of a kind of access. Rebind refuses to
load a script with a scoped entry and an older min_sdk, an unknown family, or
a malformed scope.
Rules:
- Network. Ports and schemes are not matched, so
net:127.0.0.1reaches every local port. A script limited tonet:entries follows no HTTP redirects (it gets the3xxresponse) and cannot set aHostheader.rb.net.listen,ws_listen,udp_listenandlocal_ipstill need barenet. Listingnetwithnet:entries is refused. A call to a host the list does not name raises, for exampleNet.Get() to '<host>' is blocked: permissions do not list net:<host>. - Clipboard and screen. A script that declares permissions reaches the
clipboard only through its
clipboard:entries and the screen only throughscreenorscreen:target, sopermissions = []allows neither. Listingscreenwith ascreen:entry is refused. Anoneentry cannot be combined with another entry of its family, and a script lists at most onescreen:entry. screen:targetneeds a positivewindow,process,window_regexorprocess_regexrule. A read outside the window, or while another window is focused, raises.rb.screen.listandrb.screen.work_areastay open.
exec and typing through rb.hid can reach the network without a
net entry, and hosts are matched by name, not by the address they resolve to.