Persistence
Save key/value pairs that survive between script runs and REAPER sessions, or within a project file.
Kind: how-to
ReaScripts can keep persistent data by using standard file functions, but the following API functions are recommended for portability:
-
SetExtState() and GetExtState() allow ReaScripts to set and get key/value pairs that will persist between ReaScripts, and optionally persist between REAPER instances as well. For example, a Python module called "utility" might want to remember that some flag is set:
RPR_SetExtState("utility", "someflag", "2", True) val=RPR_GetExtState("utility", "someflag") # even if called after REAPER is closed and reopened, val will be equal to "2" -
SetProjExtState() and GetProjExtState() allow ReaScripts to save data within the project RPP file.