To run a job in batch, use the flowchart modules at the upper left of the Cupboard, and link them together. The flowchart modules pass messages to each other over their links, rather than images. Each message has two key elements: a directory (folder) name and a file name.
The initial directory name is set as an absolute path in the “start” module's argument. start passes this directory name, with a blank file name, to the “ls” module.
The “ls” module uses a “filter” argument to match the file names in the directory. The filter contains wild-card characters that match more than one character in a file name. For example, the asterisk * matches any number of characters: the filter Smith*MB*.tif matches any name that starts with “Smith”, has “MB” somewhere in the middle, and ends with “.tif”. For more filter options, see ls filters.
ls passes one message for each file name that matches the filter. If 5 file names match, 5 messages are sent, one at a time, each with the directory name and one of the file names.
The “rpt” (repeat) module counts the incoming messages, and waits until the loop completes before passing a message on to the next module.
The “exec” module receives each message with the directory name and file name, and substitutes them into the arguments of the attached job (“Untitled” in the figure). The attached job uses special arguments called dynamic variables instead of absolute path names. How the names are substituted into them is set in exec's own arguments; see Arguments for "exec".