Scripts

Contents


Scripts were developed for early multimedia SuperMemo courses in the 1990s. They are retained for compatibility only. The tools of incremental learning, videos, HTML, etc. may be used instead at much lower implementation cost.

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)
  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:

PLAY 3GOTO 1

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 download a free collection Advanced Tests with SuperMemo which you can inspect for some simple examples. Use Search : Other registries : Script to inspect scripts..

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

Execute

Internet

Learn

Playing

Showing

SuperMemo

Tests

Comment