To use each type in FME, prefix each directive (i.e. the GUI type name followed by some arguments; see Syntax for more info) with GUI. For example, for the GUI type TEXT, the line
GUI TEXT stringVariable
Enter some text:
...will create a text input field that has the label "Enter some text:". The value of this field is stored in the macro stringVariable.
The default value for the macro can be specified with an additional line:
DEFAULT_VALUE stringVariable
This is the default text
GUI TEXT stringVariable
Enter some text:
This will create a text input field that has the label "Enter some text:" with the string "This is the default text" already entered in the input field.
The parameter can be made optional (i.e., no user input is an acceptable state) if the keyword OPTIONAL is placed before the GUI type. For example,
GUI OPTIONAL TEXT optionalStringVariable
Enter some additional text:
The following describes the general syntax for using the various GUI types available. Syntax specific to each GUI type can be found by selecting the appropriate type from the menu on the left.
[-]DEFAULT_VALUE <macroName> <defaultValue>
[-]GUI [flags]+ COMMAND <macroName> <configString> <label>
The directive always begins with the GUI type name, say COMMAND (in practice, this is case-insensitive). It is followed by one or more arguments, denoted by angled brackets.
COMMAND <arg1> <arg2> <arg3>
The usual order of these arguments is as follows:
COMMAND <macroName> <configString> <label>
In this documentation, we have denoted an optional argument with square brackets.
COMMAND <arg> [<optional>]
As in regular expressions, an asterisk denotes that the previous grouping may be repeated. Typically, the grouping is an optional argument.
COMMAND <arg>[%<optional>]*
An example usage of the above syntax would be "COMMAND value%value2%value3". Note that the syntax description is space-sensitive. All other symbols are literal.
LOOKUP <macroName> <from>,<to>[%<from2>,<to2>]* LOOKUP_GLOBAL <from>,<to>[%<from2>,<to2>]*
This type maps values from one value to another. If a LOOKUP directive is specified, whenever a macro returns a value that matches <from> exactly, it will be changed to <to>. LOOKUP only affects a single given macro at a time, whereas LOOKUP_GLOBAL affects all macros in the same dialog. When both a global and non-global LOOKUP exist with equivalent <from> statements, the one from the non-global overrides the global mapping.
# map "foo" to "local" GUI LOOKUP MAPPED mapMe foo,local # map "foo" and "bar" to "global" GUI LOOKUP_GLOBAL foo,global%bar,global GUI CHOICE MAPPED foo%bar%baz Choose one:
When the user chooses "foo", "local" is returned.
# map "bar" to "local" GUI LOOKUP MAPPED mapMe bar,local # map "foo" and "bar" to "global" GUI LOOKUP_GLOBAL foo,global%bar,global GUI CHOICE MAPPED foo%bar%baz Choose one:
When the user chooses "foo", "global" is returned.
Note: LOOKUP_GLOBAL has a drawback where the value of 0, if assigned to any parameters, will be treated as if no value has been set to that parameter and a different value has to be used in UT. It is recommanded to use LOOKUP <macroName> <Unused>,<value>
for compatibility with UT.
-GUI LOOKUP_GLOBAL,0 -GUI LOOKUP CLIP_TO_ENVELOPE ,No