Unpack/zip in another pane
-
txnoodles@gmail.com
- Posts: 5
- Joined: 27 Mar 2021 10:10
Unpack/zip in another pane
Hi,
would it be possible to unpack a file from one pane into the other ? I did run a search on site but I'm none the wiser.
Thanks
would it be possible to unpack a file from one pane into the other ? I did run a search on site but I'm none the wiser.
Thanks
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: Unpack/zip in another pane
I do it with this script on a button, it uses 7zip.txnoodles@gmail.com wrote: ↑27 Mar 2021 10:13 Hi,
would it be possible to unpack a file from one pane into the other ? I did run a search on site but I'm none the wiser.
Thanks
Edited to also extract more than one selected archives.
Code: Select all
// Extracts the selected archive(s) to the inactive pane using 7-Zip.
// Check if there's at least one (archive) file selected
$selected = <get SelectedItemsPathNames <crlf>>;
end (gettoken($selected, "count", <crlf>) == 0), "No (archive) file(s) selected, aborted!";
focus "PI";
foreach($item, $selected, <crlf>, "e") {
if (exists($item) == 2) { continue; }
Run("""C:\Program Files\7-Zip\7zG.exe"" x ""$item"" -o""<curpath>""");
};
Focus "PI";
Last edited by Horst on 27 Mar 2021 16:52, edited 1 time in total.
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Unpack/zip in another pane
Maybe a bit better...
Code: Select all
// Extracts the selected archive to the inactive pane using 7-Zip
$app = "C:\Program Files\7-Zip\7zG.exe";
end (exists($app) != 1), "Application not found, aborted!";
// Only proceed if a second pane is open...
if (get("#800") != 1) {
status "No dual pane active, aborted!", "8B4513", "stop"; end true;
}
// Check if there's an (archive) file selected
end (get("CountSelected") != 1 || exists(<curitem>) != 1), "No single (archive) file selected, aborted!";
// Extract to inactive pane
$base = gpc(<curitem>, "base");
$dst = get("path", "i") . "\" . $base;
run """$app"" x ""<curitem>"" -o""$dst""";
focus "PI";
selectitems $dst;
One of my scripts helped you out? Please donate via Paypal
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: Unpack/zip in another pane
No, thats not what I want and also (at least for me) not the expected behaviour for a dual-pane archive extract.highend wrote: ↑27 Mar 2021 12:38 Maybe a bit better...Code: Select all
// Extracts the selected archive to the inactive pane using 7-Zip $app = "C:\Program Files\7-Zip\7zG.exe"; end (exists($app) != 1), "Application not found, aborted!"; // Only proceed if a second pane is open... if (get("#800") != 1) { status "No dual pane active, aborted!", "8B4513", "stop"; end true; } // Check if there's an (archive) file selected end (get("CountSelected") != 1 || exists(<curitem>) != 1), "No single (archive) file selected, aborted!"; // Extract to inactive pane $base = gpc(<curitem>, "base"); $dst = get("path", "i") . "\" . $base; run """$app"" x ""<curitem>"" -o""$dst"""; focus "PI"; selectitems $dst;
Your version creates a sub-dir in the inactive pane and extracts the content of the archive into this sub-dir.
If the archive contains sub-dirs they are then sub-dirs of the newly created sub-dir and not of the inactive pane.
Also it sets the focus into the inactive pane which prevents to continue with unpack more archive from the active pane.
My version extracts the content of the archive into the dir of the inactive pane
and stays in the active pane.
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
-
txnoodles@gmail.com
- Posts: 5
- Joined: 27 Mar 2021 10:10
Re: Unpack/zip in another pane
Thanks a lot for the script.Would it be possible to make it so that I can unzip multiple files at once ? As is now I can only un pack 1 file at a time.Thanks
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Unpack/zip in another pane
Code: Select all
// Extracts the selected archive(s) to a subfolder of the inactive pane using 7-Zip
$app = "C:\Program Files\7-Zip\7zG.exe";
end (exists($app) != 1), "Application not found, aborted!";
// Only proceed if a second pane is open...
if (get("#800") != 1) {
status "No dual pane active, aborted!", "8B4513", "stop"; end true;
}
// Check if there's at least one (archive) file selected
$selected = <get SelectedItemsPathNames <crlf>>;
end (gettoken($selected, "count", <crlf>) == 0), "No (archive) file(s) selected, aborted!";
// Extract to inactive pane
$iAPPath = get("path", "i");
foreach($item, $selected, <crlf>, "e") {
if (exists($item) == 2) { continue; }
$base = gpc($item, "base");
$dst = $iAPPath . "\" . $base;
run """$app"" x ""$item"" -o""$dst""";
}
One of my scripts helped you out? Please donate via Paypal
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: Unpack/zip in another pane
Its not clear what script you prefer ?txnoodles@gmail.com wrote: ↑27 Mar 2021 13:29 Thanks a lot for the script.Would it be possible to make it so that I can unzip multiple files at once ? As is now I can only un pack 1 file at a time.Thanks
Should all selected archives be extracted into the dir of the inactive pane ?
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
-
txnoodles@gmail.com
- Posts: 5
- Joined: 27 Mar 2021 10:10
Re: Unpack/zip in another pane
Correct.I would like, if possible, to be able to unpack one or more files at the same time.
-
txnoodles@gmail.com
- Posts: 5
- Joined: 27 Mar 2021 10:10
Re: Unpack/zip in another pane
Horst wrote: ↑27 Mar 2021 13:51Its not clear what script you prefer ?txnoodles@gmail.com wrote: ↑27 Mar 2021 13:29 Thanks a lot for the script.Would it be possible to make it so that I can unzip multiple files at once ? As is now I can only un pack 1 file at a time.Thanks
Should all selected archives be extracted into the dir of the inactive pane ?
Thanks a ton this works great.One more thing can this script also unpack other files like *rar and things ? It would be great.
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Unpack/zip in another pane
What? It extracts what you application can extract. And 7zG extracts .rar just fine...
One of my scripts helped you out? Please donate via Paypal
-
txnoodles@gmail.com
- Posts: 5
- Joined: 27 Mar 2021 10:10
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Unpack/zip in another pane
And you you have dual pane open? The end statement works fine here...
One of my scripts helped you out? Please donate via Paypal
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: Unpack/zip in another pane
I always have dual pane.
There comes no message if a dir is selected which of course doesn't make sense but can happen.
It would be nice if there would be a message if no file but anything else is selected.
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Unpack/zip in another pane
You mean something like this?
Code: Select all
// Extracts the selected archive(s) to a subfolder of the inactive pane using 7-Zip
$app = "C:\Program Files\7-Zip\7zG.exe";
end (exists($app) != 1), "Application not found, aborted!";
// Only proceed if a second pane is open...
if (get("#800") != 1) {
status "No dual pane active, aborted!", "8B4513", "stop"; end true;
}
// Check if there's at least one (archive) file selected
$selected = <get SelectedItemsPathNamesSlashed>;
$cntSelected = gettoken($selected, "count", <crlf>);
end ($cntSelected == 0), "No (archive) file(s) selected, aborted!";
$cntFiles = gettoken(formatlist($selected, "f", <crlf>, "!*\"), "count", <crlf>);
end ($cntSelected != $cntFiles), "Folder(s) can't be selected, aborted!";
// Extract to inactive pane
$iAPPath = get("path", "i");
foreach($item, $selected, <crlf>, "e") {
$base = gpc($item, "base");
$dst = $iAPPath . "\" . $base;
run """$app"" x ""$item"" -o""$dst""";
}
One of my scripts helped you out? Please donate via Paypal
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: Unpack/zip in another pane
That gives "Folder(s) can't be selected, aborted" message even when only file(s) are selectedhighend wrote: ↑27 Mar 2021 17:10 You mean something like this?
Code: Select all
// Extracts the selected archive(s) to a subfolder of the inactive pane using 7-Zip $app = "C:\Program Files\7-Zip\7zG.exe"; end (exists($app) != 1), "Application not found, aborted!"; // Only proceed if a second pane is open... if (get("#800") != 1) { status "No dual pane active, aborted!", "8B4513", "stop"; end true; } // Check if there's at least one (archive) file selected $selected = <get SelectedItemsPathNamesSlashed>; $cntSelected = gettoken($selected, "count", <crlf>); end ($cntSelected == 0), "No (archive) file(s) selected, aborted!"; $cntFiles = gettoken(formatlist($selected, "f", <crlf>, "!*\"), "count", <crlf>); end ($cntSelected != $cntFiles), "Folder(s) can't be selected, aborted!"; end true; // Extract to inactive pane $iAPPath = get("path", "i"); foreach($item, $selected, <crlf>, "e") { $base = gpc($item, "base"); $dst = $iAPPath . "\" . $base; run """$app"" x ""$item"" -o""$dst"""; }
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
XYplorer Beta Club