Structure of a Script Collection
Each script collection contains a number of commands (elements of the script collection).
This is reflected in the display on the GUI:
Each command points to one specific Tcl procedure within a specific Tcl script. When a command is carried out, the TCL procedure it points to is called.
To define a script collection, you have to define:
- The name of the collection
- The commands contained in the collection
- Optionally: Some further information like version number, description, etc.
- Optionally: A GUI icon representing the script collection.
- for each individual command:
- Command name
- Tcl file it points to
- Tcl procedure within this file it points to
- Arguments that need to be passed to the Tcl procedure (the values required will be prompted at starting a command from the GUI)
- Command mode (see Command Options below)
- Optionally: Command scope (see Command Options below)
- Optionally: Some further information like version number, description, etc.
- Optionally: A GUI icon representing the command (see Command Options below). If you don't provide an icon file, a default icon will be used for representation in the GUI.
All listed information (describing exactly one script collection) is stored in one XML file.
You can define multiple script collections.
Command Start
When defining a command, you need to define which way the command can be started on the GUI. You have two options:
- Trigger mode: The command is started via click on a GUI button. The GUI button is available in the Script Collection pane of the VisualApplets GUI. It looks like this:

- Drag & Drop mode: The command is carried out only after a Drag & Drop from the Script Collection pane into the design window of VisualApplets. The Drag & Drop mode is represented in the Script Collection pane by a hand symbol:

Command Scope
For commands set to trigger mode, you can define the command scope. The command scope defines if design elements need to be selected for being modified by the Tcl procedure, and if yes, which elements this are. (You may, for example, have defined a Tcl procedure that alters the parameters of one or multiple links in a design, or a procedure that is to be carried out exactly on one module, etc.)
The following options are available:
- Module: Exactly one design element must be selected. This element must be a module.
- Link: Exactly one design element must be selected. This element must be a link.
- CommentBox: Exactly one design element must be selected. This element must be a comment box.
- SimModule: Exactly one design element must be selected. This element must be a simulation module.
- SingleSelect: Exactly one design element must be selected. Which kind of element is selected (module, link, ...) is not relevant.
- MultiSelect: Two ore more design elements must be selected. Which kinds of elements are selected (module, link, ...) is not relevant.
These options can be combined: If you, for example, combine the options Module and Link, the command will be carried out if the user on the GUI selects either exactly one module OR exactly one link. Combining SingleSelect and MultiSelect allows starting the command if one ore more design elements are selected.
If a GUI user tries to carry out a command without selecting the design elements defined as command scope, an according message is displayed, for example:
Toolbar Buttons for Commands
For commands set to trigger mode, you can arrange that a command button is added to the tool bar of the VisualApplets program window. A click on the command button in the tool bar will have the same effect as a click on the command button in the Script Collection pane.