Writing scripts to add life to SuperMemo elements

The script component makes it possible to use a simple script language to manipulate other components in a given element (i.e. to display components, change their position, animate them, use them in learning tests, etc.). This way you can create interactive presentations, animation, video subtitling, drag-and-drop tests, hyperlinks to the Internet, e-mail links, etc.

To create a script do the following:

  1. create an element with contents of your choice (components, their position, their attributes, etc.)
  2. add a script component from the Compose toolbar (i.e. click the component button and two locations in the element area)
  3. right-click the script component and choose the Script option on the component menu
  4. write the script program (see below) and choose OK

While writing the script, use the script editor's context menu that makes it possible to insert full command syntax into the editor (right-click the editor to open the menu).

For example, to repeatedly play music from a sound component number 3 (see below), you could write:


To view component number tags click 123 speed-button on the Compose toolbar, or choose Components : Component order (Shift+Ctrl+O) on the element menu. Note, that when you right-click within the element window, you will either open a component menu (if you click over a component) or the element menu (when you click an empty area within the element).

The best way to learn more about scripts is to inspect scripts in multimedia collections shipped with SuperMemo, e.g. Cross Country, Video English, Easy English, etc. Use Search : Other registries : Script to inspect scripts. Alternatively you can download a free collection Advanced Tests with SuperMemo from SuperMemo Library for some simple examples.

Important: apostrophe is reserved in scripts for delimiting string variables. If you need to include an apostrophe in a string, use a backquote instead. For example:

TEXTOUT 3 'I`m delighted to have met you'

Script commands used in SuperMemo