Script objects execute several lines of commands when the user clicks on the object. The Script object type is based on the object type 'Lines', i.e. it can display several lines of text with an optional background color filling the rectangle. Basically you can consider it to be a button that starts an action.
The edit command of a script object brings up the following dialog:

The text field on top lets you write the description to inform the user about the script. The first line of the description will be displayed using bold letters.
The bottom part contains the script lines that are executed. Each line must contain one command. Each command may have several parts, separated by commas. The commands available at present are described below.
If you want to avoid that the user can change the script object you can check the 'Check password when user tries to edit script' option and set a password in the password editor.
Script commands
Script command |
Explanation |
|---|---|
update data |
Re-computes the whole configuration, used when the model needs an update after a parameter change |
update plot |
The main view is drawn, used when changes of the model should become visible to the user |
edit sample description |
Lets the user modify the sample description in a dialog |
set sample description,sample 0815 |
Changes the sample description to the new text 'Sample 0815' |
edit master parameter, master parameter name |
Shows a dialog which lets the user change a master parameter |
edit fit parameter, fit parameter name |
Shows a dialog which lets the user change a fit parameter |
set emissivity, spectrum name, position, value |
Sets an emissivity value which then can be used for the computation of a U- or g-values. The U- or g-values to be computed must be linked to the spectrum. The name of this spectrum is passed as second item of the command. The third parameter identifies the position in the stack, counted as 1, 2, 3, 4 beginning on top of the stack (which means 'outside'). Finally, the fourth parameter is the value of the emissivity. |
object command, argument 1, argument 2, ... |
This is a general script command which may have several arguments, depending on the object to be called. Usually the first argument is the name of the object to be activated, followed by the name of an action and more parameters to be passed.
The section below lists the implemented commands of various object types. |
Implemented object commands
Spectrum simulation objects of type 'R,T,ATR':
object command, spectrum object name, import measured spectrum (executes the dialog to import a measured spectrum)
Layers of type 'Measured plate':
object command, measured plate name, import transmittance (executes the dialog to import the transmittance spectrum of this measured plate object)
object command, measured plate name, import reflectance top (executes the dialog to import the reflectance spectrum (radiation from the top) of this measured plate object)
object command, measured plate name, import reflectance bottom (executes the dialog to import the reflectance spectrum (radiation from the bottom) of this measured plate object)