Wow! Thank you so much,
@highend and @admin -
@admin -
About the type-o, I'm worthless without IDE's + interpreters (lol). I'll waste 10x more time debugging due to a variable-name type-o than real issues!
@highend -
Your solution worked perfectly cut-and-paste without changes, thank you!
There was one item I didn't understand; the "
get SelectedItemsPathNames" passed a pipe ("|") but the ForEach split on <crlf>.
This worked fine; however, I was curious if it would work if I split on pipe. Because it did, I left that as pipe rather than <crlf>.
While XYplorer was not running, I also modified one of the two .INI parameters you mentioned:
Code: Select all
ZipPathUnRAR=
ZipPath7zip=C:\Program Files\7-Zip\7z.exe
(I use 7-Zip for my RAR's and from the config help-file it appears this is the proper method?)
I did run into a small issue with
using the intrinsic zip_extract command:
Code: Select all
zip_extract($archive, gpc($archive, "path") . "\" . gpc($archive, "base"));
Works fine; with two issues (1) it's very slow; (2) I see the Windows standard dialog "copying" files rather than 7-Zip; (3) I do not see 7z.exe run in the task manager.
My assumption was that I had a type-o in the path to 7z.exe; I pasted into a CMD prompt and it ran file.
I also tested by quoting the path; however, XYplorer would remove quotes upon exiting; therefore, I felt certain that it does not require quotes.
If anyone has ideas on what I might be doing wrong, I'd love to know for academic/learning purposes.
For now I've worked around this and will post so that future searches can find this example code. I've added a bunch of comments to help anyone new to this:
Code: Select all
//Indent all lines by 1+ spaces
//Populate $ArchiveList with Search-Results (combine with "|" delimiter)
$archiveList = quicksearch("*.7z;*.rar;*.zip", <get SelectedItemsPathNames |>);
//Split FileList by "|" -- Skip "e"mpty files
foreach($archive, $archiveList, "|", "e") {
//Set the Status Display Msg in XYplorer GUI
status "Extracting " . gpc($archive, "file") . " ...", , "progress";
//echo $archive; //For debugging
//Intrinsic XYplorer extraction:
//zip_extract($archive, gpc($archive, "path") . "\" . gpc($archive, "base"));
//Alt: Run 7-zip to extract -- Extract to Orig Path + Create Dir named w/filename (no extension)
run """C:\Program Files\7-Zip\7z.exe"" x ""$archive"" -o""" . gpc($archive, "path") . "\" . gpc($archive, "base") . """ -aoa -y";
}
//Clear Status Display
status "";
Thank you again; the extent of XY's features are just insane. Calling it the "
Swiss Army Knife" of File Managers would be a
massive understatement ;-)
Now on to writing a script to make a few dozen search/replaces which I had been doing previously with D.O. using regex; however, this will be much cleaner in XYplorer w/Script + Catalog!