Page 1 of 1

Delete specific folders after unzip

Posted: Tue Nov 22, 2022 5:45 pm
by ChritianK
Hi all,
I receive zip file contains PDFs and assembly InDesign files with its folders Links and Documents Fonts.

I made a flow to unzip file, and to Keep only the PDFs files : it's ok. But it keep too PDFs that are inside the links folder from InDesign, when a PDF is imported in a .indd files.

Is there a way to delete after unzip function the folders " Links" and "Documents Fonts" . I used the Delete module, but it doesn't delete folders, only files.
Thanks,
ChristianImage

Re: Delete specific folders after unzip

Posted: Wed Nov 23, 2022 9:53 am
by freddyp
It is a useful feature request for a next version, but that will not be for the very near future.

If the name of the folder is always the same (Links) I suggest to use "Execute command" to execute a shell script or batch file that removes the Links folder. The "Arguments" should contain "[Job.Path]" as the first parameter passed to the shell script/batch file (do not forget the quotes).

On OSX the shell script will look like this:
#!/bin/bash
cd "$1"
rm -R Links

Do not forget to do chmod +x on the shell script!

And on Windows the batch file would be:
cd /d %1
del /s /f /q Links

NOT TESTED.

There is a less efficient possibility using "Ungroup job" and "Assemble job" so try this first.

Re: Delete specific folders after unzip

Posted: Wed Dec 14, 2022 4:15 pm
by ChristianK
Thanks Freddyp for your answer,

Finally I found a way, I made it with 2 flows :
- First unzip the files in archive hierarchy
- Second flow submit the archive hierarchy and then define conditions to keep only needed files, all others goes to Trash.

Regards,
Christian

Re: Delete specific folders after unzip

Posted: Thu Dec 15, 2022 9:30 am
by freddyp
Good thinking! Thanks for the feedback.