Specifications

for an outgoing connection) as displayed in the canvas; this may be
an empty string.
Accessing injected properties
The connection class offers the same functions for accessing injected properties as the Switch
class; the function descriptions are not repeated here.
Only outgoing connections have injected properties.
Accessing files at the other end of the connection
Returns the number of files currently residing in the folder at the other
end of this connection (the originating folder for an incoming
getFileCount( nested :
Boolean ) : Number
connection, the target folder for an outgoing connection). If nested is
false, only items directly inside the folder are counted (i.e. each file
and each subfolder is counted as one item). If nested is true, the
number of files in subfolders are counted as well, recursively (and
subfolders themselves do not contribute to the count).
Returns the size in bytes of the contents currently residing in the folder
at the other end of this connection (the originating folder for an
getByteCount( ) :
Number
incoming connection, the target folder for an outgoing connection).
Files in subfolders are included in the count, recursively.
Note:
The getFileCount() and getByteCount() functions tally any and all files that are reported by the
file system to reside in the connection’s folder at the instant of the function’s invocation, including
files that have not yet fully arrived, and (for outgoing connections) including files that have
been placed in the target folder by other processes. As a consequence, the return value of these
functions may vary between subsequent invocations as files are added/removed/updated under
or outside of the script’s control.
Job class
An instance of the Job class represents a job (file or job folder) waiting to be processed in one
of the input folders for the flow element associated with the script (see working with job folders
and internal job tickets for background information). Job objects can be obtained through
functions of the Switch class.
The second argument passed to the jobArrived entry point is the newly arrived job that triggered
the entry point’s invocation. This is commonly called the current job. By convention, the name
for the object representing the current job is “job” (although the script developer can choose to
use another name).
Processing a job
Processing a job in a script usually consists of the following steps:
Decide on how to process the job based on file type etc.
Get the path to the incoming job.
Get a temporary path for one or more output files or folders.
463
Enfocus Switch 10