Variable settings files contain a list of variables to set. They are nothing to do with data merge. Variable settings files are used in two places
· They can be in files, read before starting the job
· They can be used with the Set Variables command in sequences, to set extra variables during execution. In this case the contents of the file are just edited in a window (you can paste from a file, but there is no specific connection to a file). These might use variables set earlier, or results from previous steps. They can be used in Condition commands, so they can be set only when certain contains are met.
Variable files are simple text files which list variables and values. For example a file might contain
COPIES=3
ADDTEXT="Volume 4"
This sets the variables COPIES and ADDTEXT. All values can be in quotes, but numbers need not be.
A variable file can have comments, which start on any line with # or //. If these need to be part of a value, the value must be in quotes. A file can also have blank lines.
Variable files are expected to use UTF-8 encoding for text.
The value can be an expression like
ADDTEXT=CONCAT(BOOKTITLE," (PROOF)")
Expressions are described in a Variables: Expressions.
Certain characters are special in a string. For example, you cannot simply use " when you want a quote, because it will end the string. There are two different ways you can specify a quote in a string. For example to set NAME to THE "REAL" THING you can use either
· NAME="THE ""REAL"" THING" – doubling up each quote
· NAME="THE \"REAL\" THING" – using \ as an escape and \" to mean a quote
You also cannot simply use \ in a string, because it is part of an escape. So \ must be written as \\. This is important for file names in Windows.
There may be other commands in a variables file. Currently only MSG and EXPORT are supported. Commands are recognised as not setting a variable because the command name is not followed by ‘=’. Incorrect commands may be ignored without error.
MSG expression
causes the current value of the expression to be written as a message. In Quite Hot Imposing, this implies it is written to the log file (using watched folders or Enfocus Switch) or to the command output (using command line). MSG can be used to check that variable values are as expected or follow progress. Examples
MSG "Variable information follows"
MSG "Width is " & WIDTH & ", height is " & HEIGHT
EXPORT name
adds name to the list of variables to be exported. It does not set a value to export, nor cause the export to happen at that time. Exporting happens at the end of the job, with the current value of the named vaiable. If name is *, this means that all variables will be added. The effect of EXPORT is the same as using the -varexport command line parameter.
The Set Variables command can be used in any automation sequence when variables are enabled. The syntax is exactly the same as the variables text files, but no actual file is read. It can be used between commands, before the first command, or after the last command. Some possible uses of the Set Variables command include:
· Setting calculated values so that calculations do not have to be repeated many times, or simplify calculations by making them in several steps.
· Having a sequence which uses variables internally, for example sets rows, columns and copies in a Set Variables commands at the start. Changing the sequence may be more efficient this way.
· Adding documentation or information about the sequence, since the file can include comments starting # or //.
· Conditionally setting variables, using a Condition command. For example you could set variables based on number of page sizes, metadata in the PDF, or file names.
· Listing variables to export
· Writing variable values or messages to the job log
Note that if you want to set defaults, most methods will not work because any reference to an undefined variable will give an error. You can set variables in this way:
var_name=[User:var_name|default value]
since the form [User:variablename|default] sets the default rather than giving an error.
The default variable file format is the lines of text described above, but additional formats might be used. They can be used from the command line but cannot be used as an alternative for the Set Variables command.
Some application environments might make it easier to process XML files than text files. This is the case with Enfocus Switch, a separate app that can interface to Quite Hot Imposing. There are many possible XML formats, and we only process one specific format. More XML tags can appear and will currently be ignored. The XML format looks like this for name1=value1 name2=value2.
As many fields can be included as you wish. The following rules are applied to working with the names.
1. Any space in the name is replaced by an underscore.
2. If the name contains parentheses (round brackets), everything is ignored except the part inside the parentheses. For example a name text of “Number of columns (cols)” will set a variable name of “cols” only.
3. After these changes to the name, if there is anything other than upper or lower case unaccented English letters, digits, or an underscore, then no variable is set.
The variable value is treated as text, is not converted or limited.
To read a file in XML fields format, use the command line
option ‑vars:xml:fields filename.
You can also export (see below) in this format using ‑exportvars:xml:fields filename.
Multiple files might apply. All variable definitions are processed and the LAST one encountered is the one that is used.
When Quite Hot Imposing is watching a folder, the folder can contain a file qvars.txt. If this file is found, it will be used for each job to set the variables.
When Quite Hot Imposing is reading a job folder, this folder can contain a file qvars.txt. If this file is found, it will be used for this job only. This is read after any watched folder qvars.txt, so if a variable is defined in both places, the job folder file takes precedence.
When using the command line, the command line parameter ‑vars filename can be set to specify variable files to read. (Also -vars:xml:fields) The option can be used more than once, and all the files are read in order, to set variables in the order specified.
When using Enfocus Switch, the Hot Imposing app or configurator can be used to set variables from Switch private data. When the option is set, all Switch private data is automatically used to set variables, provided the private data value has a suitable name.
When using Enfocus Switch the command line parameter -vars filename can also be set. The form ‑vars dataset::datasetname can also be used.
When using Enfocus Switch the special command line option ‑switchfields list takes a list of dataset names, and reads each of them as if specified with‑vars:xml:fields.
Note that single variables can be set in the command line. ‑v:key "value" (or the legacy option ‑User:key "value") continues to be available in command line, in Switch, and in advanced queue options. Currently, these are all overridden by definitions in variable files, but this may change without notice. Unlike a variables file, the value cannot be an expression, it must be a simple string or number. ‑v:rows 3 is allowed, -v:rows value+2 is not allowed.
Summary of options by environment
Option |
Watched
folder |
Enfocus
Switch |
Command line |
Value can be
expression |
Can refer to
document |
qvars.txt in
watched folder |
Yes |
- |
- |
Yes |
No |
qvars.txt in
job folder |
Yes |
Yes |
Yes |
Yes |
No |
-vars command
line |
Yes |
Yes |
Yes |
Yes |
No |
-vars dataset::name |
- |
Yes |
- |
Yes |
No |
-v:key value |
Yes |
Yes |
Yes |
No |
No |
-User:key value |
Yes |
Yes |
Yes |
No |
No |
Set Variables
command |
Yes |
Yes |
Yes |
Yes |
Yes |
It can be useful to pass information out of Quite Hot Imposing. Exporting is based on a list of names only. When the process is finished, the list of names is checked, and the matching values are exported in a number of possible ways. Exporting is always based on the final value of a variables.
What you export can be
· The value of a variable you set at the start
· The value of a variable you calculated (in a Set Variables command)
· The value of the result of a command (see below)
You can export to a file (chosen in advance), or you can export to the Quite Hot Imposing output if using the command line. In Enfocus Switch you can export to private user parameters.
You can also specify that the results from particular commands are automatically exported.
In Enfocus Switch, the option Connect Switch metadata: Private data + datasets is most often used. This option is used in a Switch Flow setup. It automatically exports ALL variables to Switch Private Data. There is no need to give a list.
Quite Hot Imposing, used with the command line, has option ‑varexport name to add names to the export list. ‑varexport "*" causes all variables to be exported.
Quite Hot Imposing also has the option -exportvars filename to specify an output file. The file is written in the same format expected for input -vars files.
For command line use only, Quite Hot Imposing has -exportmarker "string" to direct exports to output file stderr.
Variables files, read at startup or used in a sequence with the Set Variables command can contain a line
EXPORT name
which also adds name to the list to export, or you can use
EXPORT *
for all names (including those not yet set).
It is often useful to get information from a command, and pass it back out of Quite Hot Imposing, to some other process. Only certain commands will set results. If Results are available, the Results button in the Sequences editor will be available.
In this example, the Step & Repeat command has been highlighted at the right hand side, and the Results button is available.
When Results is clicked, a dialog like this one will appear.
· If you do not check any boxes, nothing will happen (no results are saved, even if you change the name).
· If you click the Variable box but not the Export box, a variable is set, which can be used in later steps. You can use the suggested name (like nup_max_rows) or type a different name.
· If you click the Export box a variable is set, AND the variable is marked for exporting.
The list of Results available is subject to change but currently it is as follows:
N-Up Pages: maximum rows on any sheet; maximum columns on any sheet; number of input pages; number of output sheets.
Step and Repeat: as N-Up pages, with the addition of: minimum repeated pages per sheet; maximum repeated pages per sheet; total pages placed (total of all copies).
Repeat Manual Imposition: number of input pages added by repeat; total sheets used by repeat; sheet number where the repeat started.
Variable Data Merge: number of rows used; number of rows skipped.
Please contact Quite if you would like to add variable definitions to an XML command sequence.