Sometimes, we need to change aspects of a job. Quite Hot Imposing is adaptable, for example Step & Repeat can fill a page with copies of an original without you needing to choose rows and columns. But there are times we might need to change items from one job to another.
Below we have an example of a job which can make copies of a page, and you can change the number of copies without having to edit the sequence or XML file. The number of copies is a variable, and we give it a name. We use the new features of Quite Hot Imposing 6.0 to say that the number of copies is a variable, instead of a fixed number.
There are a number of different ways to set the values of variables. For example they can be pulled out from the file name, so you could just make a file called LAYOUT APRIL-2,3 and define that the 2,3 are the number of rows and columns. Variables can also work automatically for Enfocus Switch customers – setting the variables as “user parameters” which can be used directly by Quite Hot Imposing.
This takes us through the steps of adding a variable to a sequence of commands. In this case, we want to make a variable number of copies. None of this can be done in Quite Imposing Plus, Quite Hot Imposing 6.0 or later is needed.
This is the normal “Page Tools” dialog for creating copies.
The number of copies must be a fixed number, so it is the same each time this command is used.
1. To make a sequence with variables, we start by switching this “Allow variables in commands” on in the sequence editor.
2. Now we add a Page Tools command. This shows a new “V” button next to the number of copies (and other items we could change). We click the “V” next to Copies.
3. We see New variable dialog. There are several choices. It suggests a variable name, copies. This seems as good a name as any, so we just click OK.
4. Now we return to the Page Tools dialog. We see the “V” button has changed to “V+”. This is how we can see which variables are set. If we clicked V+ we could change the variable name, or delete the variable so it returns to a fixed number of copies. Also, if we hover the mouse over the “V+” button, it shows the variable name (yellow box).
5. Now we click OK a few times and we have created a new sequence with a variable.
To pick up variables from a filename, you set a filter for the queue in queue setup.
We made a sequence
above, with a single variable, copies. We can allow the user to set the number
of copies in their file name. A typical way is to have the number of copies at
the end of the name, maybe with a dash (-) first. So, files called WORK-35, File
234 3 May-35 and XX-35 all want 35 copies. For this we use a filter of
*-<copies> as shown in the screen shot below.
Reading through the filter *-<copies> we see
1. An asterisk/star (*) which means “any number of characters”. It doesn’t mean an asterisk in the filename, which probably isn’t even allowed.
2. A dash (-). This means just what it says – the file needs to have a dash. If the file doesn’t have a dash, it won’t match the filter, and it will stay in the IN folder, unless another queue has a different filter that picks it up. Dash is convenient, but it could be any character that isn’t going to be otherwise used in the filename, including a space. You may wonder if you need a separator here, but you do need it, because otherwise Quite Hot Imposing doesn’t know where the variable starts.
3. <copies> says there is a variable copies. The <> signs don’t appear in the filename (and probably aren’t even allowed in the filename).
Any .pdf in the filename is ignored. So a file called THIS FILE-27.pdf will set copies to 27.
The setup will check and warn you if you don’t include all the variables, or if you use names that are not actually a variable (perhaps a spelling mistake). You can ignore the warning. Sometimes, for example if you set variables in a Condition command, Quite Hot Imposing cannot tell in advance whether you are setting a variable. It also cannot tell if some variables will be set in another way, such as a variables file.
Another way to set variables, which may be more suitable if using more automation, or if there are too many variables for a filename, is a variables file. Here we show how to set a variables file in the IN folder. First we make a qvars.txt file, to set copies. Here’s a screen shot of Notepad
We could save this to the IN folder in Quite Hot Imposing, and this variable is available to all the jobs which pass through that queue. We can edit the file as needed, and the file stays in the IN folder. There are other ways to set variables, this is just the simplest for testing. The variables will not affect other jobs which don’t need them. Variables set in a file name, with a filter, will take precedence over a variables file.
Some commands refer to a file. This includes
· Insert pages from file
· Stick on PDF pages
· Any background file used (see Page sizes / backgrounds in variables)
· Variable data merge (data source file)
These have a “V” button and are set like any other variable. Note the following when a variable holds a file name.
· The full file name (system path) must be given, including a directory name. For example
o A local file in Windows: c:\users\appdata\user32\documents\pdf sizes.pdf
o A network share in Windows: \\servername\folder\file37.csv
o A file in Mac: /Volumes/Macintosh HD/Files/myfile.pdf or /Users/user32/Documents/insert pages.pdf
· Any network shares must already be mounted
· The directory name must be used. If just a name is used, without a directory, it might randomly work or not work.
· File names are strings, and can be constructed with operators like LEFT, SUBSTR or CONCAT.
· Where variables are read from a variable file, note that \ is a special character, and must be written as \\. For example c:\dir\file.pdf must be written as "c:\\dir\\file.pdf" and \\server\dir\file.pdf must be written as "\\\\server\dir\file.pdf".
· File names with directory separators cannot be used inside another filename when working with filters.
When variable data merge is set up, the list of field names must be known. The only way to get the list of field names is to read a data source file. So when you click “V” to set a variable for the data source, you will also have to choose a model data merge file. This is read to find the field names. The actual file (from the variable) must have all the same fields (but the columns need not be in the same order, and it could have extra columns).
Many commands use page sizes. There are some complications to using these with variables.
1. A page size has two values, width and height.
2. In some commands, a background file can be specified instead of a width and height. There are other values associated with backgrounds, such as number of pages to repeat.
3. The page size is normally chosen from a pull down, rather than typed in as part of the setup.
For this reason, the “V” button for variables works differently with page sizes. Here is a page size in the “Adjust Page Sizes” command.
At the moment this shows there is no variable, and the size shown will be used. If we click “V” we see:
This is set up to quickly allow you to define names for both the width and height (with a suitable default). If you want more complex setup, click Page size and use “V” buttons as normal.
The screens above were from “Adjust page size”, which does not allow a background. If we were to click the “V” next to page size in “N-Up pages”, we see instead:
Notice the “Best fit” option on here, because we have no other way to select it once the page is a variable size. If clicking Background file we see
So the background file can be a variable. It is a filename, see above. Most of the selections are not variables, but if we choose “I want to do something more complicated” certain options, like page numbers, are variables.
Dimensions are often used in commands. For example, they might be the size of a page or an offset. When working in the user interface, dimensions are automatically handled according to the current preferences (inches, mm, points, cm or pica). On the other hand, in control files all dimensions are in points (1/72 inch). Users working with variables may expect to be able to enter variables in a particular unit, rather than convert everything to points.
For this reason, when a variable is defined in the user interface, the units are also saved. The value selected for the variable is also converted to points, even if it is specified as a string. This means that if the units are changed in preferences, the old unit preference continues to be used. The alternative is worse; the alternative would mean that an end-user changing the preferences for a single task breaks all the other workflows based on variables.
The conversion of units happens only as the command is executed. It does not affect the value of any variable used in calculations etc.
Users often need to enter lists. For example:
· In Shuffle pages, there is a list of page numbers and other characters to be used as a rule
· In N-Up, advanced margins and spacing, there may be a list of spacings. These are dimensions.
Lists of numbers must be entered as strings, containing the numbers. For example, to specify a shuffle rule you could use RULE="4 1 2 3".
Lists of dimensions must also be entered as strings, containing the numbers in the selected unit (inches, mm, points etc.) exactly as in single dimensions.
A number of functions are designed so they can process entire lists. For example INPT(x) can be used to convert a single value from inches to points, but it can also convert a list of values, each one is converted to points to make a new list. The functions that are useful for lists include:
· INPT, MMPT, CMPT to convert inches, mm or cm to points – INPT(2) is 144.
· PTIN, PTMM, PTCM to convert points to inches, mm or cm – PTIN(144) is 2.
· MIN, MAX can return the minimum or maximum from a list – MIN(3,1,2) is 1.
· LIST can make a list from separate values – LIST(1,2,3) is "1 2 3".
· INLIST can fetch a value from a list – INLIST("10 9 8",2) is "9".
· PAGESIZE, PAGEWIDTH, PAGEHEIGHT return a list of page sizes for a range of pages.
The Condition command is used to decide between different sequences of commands. It can be set up to use variables rather than, for example, page sizes or number of pages. This does not use the “V” button found in most other variable references. Instead, select What to check: variable. You can then enter a variable name or an expression.
The variable name, or the expression, must have a value of "TRUE" or "FALSE". No other value is allowed (it will give an error), but see the BOOL() function for converting a number into "TRUE" or "FALSE". Expressions such as comparisons will return "TRUE" or "FALSE". Examples:
· ROWS = 2
· ISODD(TARGET_PAGES)
· CONTAINS("M3",JOBNAME())
· AND(ROWS > 1,COLS > 1)
· ISEVEN( [Doc:NumPages] )
Variable names are case independent, but the variable names are preserved with their original case. This works rather like file names in Mac and Windows. You can create a file called MyFile.txt, and if you try to read myfile.txt or MYFILE.TXT it will read back the MyFile.txt file. The original case – the name you first chose – will be used. In the same way, you could create a variable NumRows, and use it as NUMROWS or numrows (or other possibilities).
Variable names can only contain unaccented letters and digits, so it is only the upper/lower case of the unaccented letters A-Z which is relevant.
Once set, the mixture of upper and lower case in the name is not relevant, unless you later export variable values., which preserves the original case of the variable name. If you export values for use in Enfocus Switch this is important, since the user values (private data) in Enfocus Switch have case dependent names.