We often get supplied batches of PDF files that will have a variable number of pages in each file. We need to batch into folders by common page extent. I could create a workflow using the route function to send to precreated folders in the save destinations to sort them, but as the page extent can vary between 1 and 50 pages this would mean creating 50 save folders and the subsequent routing parameters. Is there a more efficient way of achieving this. I have licenses for Advanced Automation and MAX.
I currently process this on a single Mac using an action we have written but moving the process over to Freeflow Core would make it available to all users particulalry as many are currently remote working.
Solved! Go to Solution.
Please see attached scripts that you can run in an External Process. This requires Python https://www.python.org/downloads/
Upload both scripts to the FFCore Scripts folder. In a workflow add an External Process and select the bat file as the script. Use the parameters:
"$FFin$" "$FFout$" "$FFwfDoc.pages$"
The bat file runs the Python script. The Python script will create sub folders in C:/Temp/ (which can be changed to a location of your preference) named 1-50 but only if the sub folders don't exist. The number of pages in each pdf is passed to the script and the pdf will be saved to the sub folder corresponding to the number of pages in it - a pdf with 8 pages will be saved to folder C:/Temp/8 and so on.
You likely need to change the path to Python and your FFCore Scripts folder in the bat file depending on where you installed Python and where the FFCore Scripts folder is installed on your server.
If you don't want to work with an external proces, you could simply use the $FFwfDoc.pags$ variable in a save destination (f.e. C:\Xerox\FreeFlow\Core\00000000-0000-0000-0000-000000000000\Data\PDF sorted Files\$FFwfDoc.pages$)
You will then have to create the 50 folders yourself once, but no need to dive into python scripting...
I had already looked at that option as well as my original thought but it means I end up with a very congested Saved Destinations folder either way. I have installed Python and that works perfectly, we are fortunate that should we need to tweak the script we already use Python coding to create dynamic charts so have the skill set available