REAPER KB

Getting Started

reascript_prose/reascript-howto-getting-started · kind=reference

Getting Started

Test your ReaScript install with APITest, then call REAPER actions via Main_OnCommand.

Kind: how-to

Just try it. Experiment!

ReaScript is mostly fault-tolerant. Most programming mistakes will give error messages that will help you fix the mistake. While it is still possible to crash REAPER with scripts, you shouldn't be able to do any permanent damage -- just be sure to save any important projects before testing ReaScripts.

A very simple way to test ReaScript is by calling the API test function:

EEL2: APITest();

Lua: reaper.APITest()

Python: RPR_APITest()

When you run this script, you should see a window that says "Test OK".

Common reasons for scripts failing are:

REAPER should show an error message when a script fails, which will point to the faulty line, when possible.

To call any REAPER built-in action from ReaScript, use Main_OnCommand(actionID, 0). Find the ID of a given action by opening the Actions window, and right-clicking it: "Copy selected action ID". For example, from ReaScript/EEL you would call the REAPER action "Item: Split item under mouse cursor" like this:

Main_OnCommand(40746, 0);

Other sections in this document