Exercise 3: Solution

This topic explains how change the sorting method from sorting based on file type to sorting based on variables.

In this example, only files with a trim box size of 144 x 252 pixels should be moved to the PDFs folder; all other files should be moved to All other files.

  1. Duplicate Tutorial 1 Flow and name it Tutorial 1C flow.
  2. Set the connection between Sort for PDF and PDFs on hold.
    1. Select the connection between Sort for PDF and PDFs.
    2. Right-click and select Hold. Alternatively, you can set the Connection property Hold jobs to Yes. This stops the flow and holds the input in the Sort for PDF folder. This will allow Switch to use this PDF as an example when defining a condition with variables.
  3. Save and activate the flow.
  4. Add a PDF file (e.g. Job_Part1.pdf) to the flow.
  5. Once the file has been moved to Sort for PDF, click to stop the flow.
  6. Define the sorting parameters.
    1. Select the connection between Sort for PDF and PDFs.
    2. In the Properties pane, select the Include these jobs field.
    3. Click and select Define condition with variables from the pop-up menu.



      In the Define condition with variables dialog the test file is listed (as shown above).
    4. Under Condition, next to the first field, click to edit the variable parameters. The Define text with variables dialog lists all the variables available for selection.
    5. Select the file at the top of the Define text with variables dialog and set the variable condition as follows:
      1. From the Groups column, select Stats.
      2. In the Variables column, select TrimBoxHeight.

        Note that the values in the column to the right change as you make your selection.The value of the selected variable in the test file (in this example: the height of the trim box in Job_Part1.pdf, i.e. 144 (pixels)) is displayed in the bottom part of the 3rd column.

      3. Click Insert variable.

        The Text with variables field displays the variable that will be used for sorting the input files, in this example: [Stats.TrimBoxHeight].

      4. Click OK.
    6. In the Define condition with variables dialog, select Equal to and type 144. You have defined the first condition.
    7. To add a second condition, click and select AND.
    8. Repeat the previous steps, to define an additional condition, i.e. set the required trim box width to 252.
    9. Click OK to complete the setup.
  7. Check your results.
    1. Select the connection between Sort for PDF and PDFs.
    2. Right-click and select Release. Alternatively, you can set the Connection property Hold jobs to No.
    3. Save and activate the flow.
    4. Drag and drop Job_1.pdf and Job_2.pdf into the Input 1 folder within the flow. Job_1.pdf is moved to the PDFs folder and Job_2.pdf is moved to the All other files folder.