Page 1 of 1

Script that will find/display all .zip files in a directory?

Posted: 21 Jun 2016 04:23
by Megalith
I'm not really sure where to start with this and could use some help. Basically, I need a quick way to find all .zip files within a directory so I can extract everything at once. I have tried using branch view and then filtering out the .zip files, but that takes a while.

I used to be able to do this easily with a program named ExtractNow; there was a context menu option that would search for all .zip files within a directory. Unfortunately, I had to stop using it since they started bundling malware/adware with it.

Re: Script that will find/display all .zip files in a direct

Posted: 21 Jun 2016 08:46
by highend
Something like this?

Code: Select all

paperfolder("ZipFiles", quicksearch("*.zip"));
Displays all .zip files in the current directory (recursive) in a paperfolder...

Re: Script that will find/display all .zip files in a direct

Posted: 21 Jun 2016 10:16
by admin
Wowee, cool script! :tup:

Re: Script that will find/display all .zip files in a direct

Posted: 21 Jun 2016 10:18
by highend
Best one I've ever written!

Re: Script that will find/display all .zip files in a direct

Posted: 23 Jun 2016 05:31
by Megalith
That definitely gives you all .zip files in a directory—but it won't let me select everything and unzip everything at once. Is that kind of thing even possible?

Re: Script that will find/display all .zip files in a direct

Posted: 23 Jun 2016 08:20
by highend
If you want to manually select files from that paperfolder list and extract them, execute this afterwards:

Code: Select all

    foreach($zip, <get "SelectedItemsPathNames" |>) {
        zip_extract($zip, gpc($zip, "path") . "\" . gpc($zip, "base"));
    }
Or if you really want to extract all found files you could do this without showing a paperfolder by:

Code: Select all

    foreach($zip, quicksearch("*.zip", , "|")) {
        zip_extract($zip, gpc($zip, "path") . "\" . gpc($zip, "base"));
    }