Delete specific folders after unzip

Post Reply
ChritianK
Member
Posts: 43
Joined: Wed Nov 29, 2017 10:57 am

Delete specific folders after unzip

Post 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
Attachments
flow.png
flow.png (121.99 KiB) Viewed 2790 times
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Delete specific folders after unzip

Post 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.
ChristianK
Newbie
Posts: 13
Joined: Wed Nov 30, 2022 1:15 pm

Re: Delete specific folders after unzip

Post 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
freddyp
Advanced member
Posts: 1008
Joined: Thu Feb 09, 2012 3:53 pm

Re: Delete specific folders after unzip

Post by freddyp »

Good thinking! Thanks for the feedback.
Post Reply