How to run scripts
In a script you can type map names, table names and column names directly in the
expressions, but you can also use parameters that replace (parts of) object
names, operations, etc. The procedure to run a script with parameters is
different from the one without parameters.
To run a script without parameters:
- In the Catalog, select a script with the right mouse button and choose Run from the context-sensitive menu, or
- in the Operation-tree, expand the Script item and double-click your script, or
- in the Script editor, press the Run Script button, or
- in the Script editor, open the File menu and
select the Run Script command, or
- type on the command line of the Main window: run scriptname
The script will be executed immediately.
To run a script with parameters:
- In the Catalog, select a script with the right mouse button and choose Run from the context-sensitive menu, or
- in the Operation-tree, expand the Script item and double-click your script, or
- in the script editor, press the Run Script button, or
- in the script editor, open the File menu and select the Run Script command, or
- type on the command line of the Main window: run scriptname
The Run Script dialog box will appear.
In the Run Script dialog box, all parameter names are listed as specified on the Parameters tab of the script editor.
- If you did not specify default objects on the Default Values tab you will need to select objects for input parameters and/or type object names for output parameters.
- If you did fill out objects on the Default Values tab, the Run Script dialog box will already be filled out with these defaults.
When the OK button is clicked and when all parameters are correctly specified, the script will be executed.
You can create your own Help for a script so that you can
explain the meaning of parameters to other users of the script. For more
information, see the Run Script dialog box.
To skip the Run Script dialog box:
Type on the command line of the Main window:
where:
scriptname |
is the name of your script |
parameter |
is the name of an ILWIS input object, or an output object, as objectname.ext |
When all parameters are correctly filled out on the command line, the Run Script dialog box will not appear, and the script will
be executed immediately:
- the first string found after the script name will replace %1 in the script,
- the second string will replace %2, etc.
Notes:
- It is not advised to use this method, because you have to remember
exactly what objects need to be specified for which parameters on the command line.
- To run a script with parameters from the command line, and when you wish to use long object names as parameters for the script, then you must use single quotes around the object names, excluding the .ext extensions.
For more information, see
How to use parameters in scripts or How to use long object names.
See also:
How to use parameters in scripts
ILWIS objects : scripts
Script editor : functionality
Appendices : ILWIS script language (syntax)