Conditional Flowcharts – if, yes, no

The Advanced level adds three flowchart modules that let a flowchart run its job only when a file exists, or only when it does not. They work with the Intermediate flowchart modules; see Batch Processing with Flowcharts.

Module What it does
if Tests whether the file in question exists in the current folder, and passes on the directory and file name with a “yes” or “no” conditional message
yes Must follow if. Tells exec to run its job if the file exists, and not to run it if the file does not exist
no Must follow if. Tells exec to run its job if the file does not exist, and not to run it if it does

exec runs its job when it receives an “exec=yes” message, or no condition at all. It skips the job when it receives “exec=no”.

Since Hoku 3.1, “if” has an editor, like exec and mkdir, to help you write its instruction. For details of the instruction, use the Help button in its argument dialog.

Example: skip images already processed

To process only images that do not have an output file yet, test for the output file with if, follow it with no, and then exec. The job then runs only for the images whose output file does not exist.