Specifications
Returns the most recent Occurrence instance of the specified
type associated with the job, or null if there is no such
getMostRecentOccurrence( type
: String ) : Occurrence
instance. If the type argument is missing or null, the most
recent occurrence is returned regardless of its type.
Evaluating variables
These functions obtain the value of a single variable in the context of the job (and if needed, in
the context of a flow element). The variable must be specified with the usual syntax including
the square brackets. Thus by definition the first argument must start with a “[“ and end with a
“]” and include no white space.
The second argument provides the appropriate Switch class instance for variables that need the
flow element context. It can be missing or null for variables that don’t need such context.
All of these functions return null if the argument has invalid syntax, if the specified variable is
unknown, if an unsupported argument is specified, if the variable needs the flow element context
and the Switch argument is null or missing, if an indexed variable is specified without its Index
argument, if the variable's text value does not conform to the format for the requested data
type, or if the text value is empty.
Returns the text representation of the variable, formatted
appropriately for the variable’s data type and taking into
account any formatting and indexing options.
getVariableAsString( variable :
String, s : Switch ) : String
Same as getVariableAsString() but interprets the string as a
decimal number (with or without a decimal point) or as a
getVariableAsNumber( variable
: String, s : Switch ) : Number
rational number (two decimal integer numbers separated by
a forward slash). For example, “1.25” and “5/4” represent the
same number. The function converts the strings “-INF”,
“-Infinity”, “INF”, and “Infinity” to negative and positive
infinity, respectively. Numbers outside the range of the
scripting language are clipped to negative of positive infinity.
Same as getVariableAsString() but interprets the string as a
Boolean value. The preferred strings are “True” and “False”.
getVariableAsBoolean( variable
: String, s : Switch ) : Boolean
If these do not match, a case insensitive comparison is tried,
then simply “t” or “f”, and finally non-zero and zero integer
representations.
Same as getVariableAsString() but interprets the string as a
date-time in the ISO 8601 format. The class of the returned
Date object is specific to the scripting environment in use.
getVariableAsDate( variable :
String, s : Switch ) : Date
Activating fonts
Activates the fonts residing in this job folder by copying them to the
specified target location. This function does nothing if the receiving job
is an individual file or if the job folder doesn’t contain any fonts.
activateFonts(
targetPath : String )
The target path specifies the folder in which the fonts will be copied,
for example an application specific font folder. If this argument is
473
Enfocus Switch 10