./features/active script
Download Features Source code Terminology References

"Embrace scripting."

Most functionality of Analysis Situs is available through scripting. We use Tcl language which we appreciate for its clearness and pure functional paradigm. Each command in Analysis Situs is formulated in the following fashion: verb minus noun, e.g.: offset-shell, start-contour, print-summary, etc.

For scripting, we have a dedicated panel where you write your commands and execute them. This panel is a bit special because it is not a usual one-line prompt, but rather the script editor where each line can be executed individually (one could have met a similar concept in the Maple sheets). Using this editor is advantageous for prototyping: you are free to insert commands to your sheet, erase unsuccessful trials, execute and re-execute lines in arbitrary order, and edit the script the way you like. We have named this concept as "Active Script" which, we think, is a more powerful paradigm than a classical command-line prompt.

Pressing the <Enter> key executes the current command at the position of a cursor. To insert a new command between the two existing ones, use <Ctrl+Enter> key combination. You may save the scripts prepared in the Active Script editor to file and execute them later with the Tcl native source command, e.g.:

source <path-to-script>

Some example scripts can be found in the "scripts" subdirectory of Analysis Situs. This directory is accessible via ASI_TEST_SCRIPTS environment variable in the Active Script console.

When specifying the path for the source command you can use both forward and back slashes.

You can also execute Tcl scripts in the batch mode without GUI.