Subtitle Processor contains Ruby scripting engine. It can run any Ruby code. Ruby is not required to be installed (As long as the scripts are using only the core functions (i.e. no 'require' statement), SP has it's own Ruby interpreter DLL.
Subtitle Processor provides a low-level scripting API, that comprises of several Ruby modules providing various methods for manipulating SP objects. There also are the high-level classes. These classes serve as a layer between the script and the low level API. Scripts should use the high level classes where possible.
Scripts are placed in the data/script directory by default, but they can be anywhere on the HDD.
Subtitle Processor maintains a list of scripts (Settings - General - Scripting) that are evaluated upon start. These scripts are loaded and a special expression is evaluated for each script: