REAPER KB

Deferred scripts

reascript_prose/reascript-howto-deferred-scripts · kind=reference

Deferred scripts

Run a ReaScript continuously in the background, reacting to events until the user terminates it.

Kind: how-to

By default, ReaScripts are run on-demand and terminate after execution. However, you can write scripts that run in the background until terminated by the user. This can be used to write scripts that react to events, such as the current playback position, a track selection change, user input, etc. See defer()/ reaper.defer()/ RPR_defer() and atexit()/ reaper.atexit()/ RPR_atexit() in the REAPER-generated ReaScript documentation.

A deferred script with a user interface window will run modelessly, and can be docked, just like a built-in REAPER window.

The list of scripts that are currently running in the background is available in the Actions menu. To stop a deferred script, or to run a new instance, click the script in this list. Note that no undo point is automatically added when running/terminating deferred scripts, unless you create one explicitly.

Other sections in this document