Syntax of WiseImage script
WiseImage script files consist of one or more lines, each of which is either a comment or a command. Any line that begins with a semicolon (;) is considered a comment, and WiseImage ignores it while processing the script file.
The command in the script contains the command name and, if necessary, one or more parameters. All command names start with the slash symbol (“/”). Command or parameter names are entered in either upper or lower case. Command or parameter names are separated with the standard separators – space symbols, tab symbols, etc.
If a script command parameter has any value, then it is entered after the parameter’s name separated by a colon. For example:
/ROTATE ANGLE:30
If a command has only one parameter, then its name can be omitted. In such a case the command name is followed by a colon, after which goes a parameter value. Applying this rule the example above may look as follows:
/ROTATE:30
Note that a command name, a colon and a parameter value must not be separated by any separator symbol.
All references to names (names of files or layers) must be enclosed in double quotes. For example, to open the image MYHOUSE.TIF from a script, use the following syntax:
/OPEN:”myhouse.tif”
Some numerical parameters may be specified in different units. For example, an image height can be either in millimetres or in inches. These units are set in the Script item of the Preferences dialog box. Type “mm” (millimetres) or “inch” (inches) for linear units and “deg” (decimal degrees) or “rad” (radians) for angle units.
The batch commands described below are divided into groups based on their functionality, such as file processing commands, filtration commands, etc.
File selection wildcards
The wildcard symbols * and ? can be used in Open, Export, InsertImage, SaveImageAs, and SaveAs commands to open a group of files, process them one by one in a loop and save changes.
If using wildcards, then it is recommended to use the Close command to stop processing the list.
In this example we open all TIF files in the SAMPLES folder, process and save them in the NEWSAMPLES folder in BMP format:
…
- Batch operators
…
/OPEN: “SAMPLES\*.TIF”
;opens TIF files from the SAMPLES folder
…
;Batch operators processing TIFs
…
/SaveAs FNAME: “NEWSAMPLES\*. *” FTYPE: “BMP”
- saves the BMP file in the NEWSAMPLES folder
…
/CLOSE - Closes the loop
The WiseImage batch processor treats them according to following rules (the same as in DOS environment):
1. Asterisk stands for any number of characters.
2. Question sign stands for a single character.
For example, the following command syntax is valid:
/OPEN: “SAMPLES\*.TIF”
as is the next example:
/OPEN: “..\\R?F.TIF” – it would open REF.TIF, RIF.TIF, RRF.TIF and so on (but not RREF.TIF) in the upper folder.
as is the next example:
/OPEN: “REF.* “ – it would open REF.TIF, REF.CWS, RRF.BMP and so on
3. If opening a number of files using wildcards, then save them using wildcard techniques:
For example, if opening REF1.TIF, REF2.CWS, and RRF3.BMP files with the command:
/OPEN: “REF*.*; *.BMP”
process them in a batch and close with the help of
/SAVEAS: “..\\*.* “ FTYPE: “CWS”
the upper folder will contain REF1.CWS, REF2.CWS, and RRF3.CWS files.
4. Use the “;” symbol in the parameter of the Open command.
Example:
/OPEN: “REF*.; DETAILS.BMP; MYHOUSE.TIF”
This list of files will contain all files who’s names begin with “REF”, DETAILS.BMP file, and MYHOUSE1.TIF, MYHOUSE2.TIF, MYHOUSE2.TIF, etc.
5. Every item of the list is processed in a loop until the Close command is executed or the next Open occurs. The Close command is a valid way to close the list and dismiss the list of processed files.
To get more information on using wildcards, see command line reference in the operational system manual. Do not use this feature until conversant with command line manipulation.
Post your comment on this topic.