Page 1 of 1

Please, help me understand

Posted: 31 Mar 2016 15:41
by rinox
Hi, I'm totally newbie with XYplorer....
I'm trying to make a button to compress/expand an archive file using 7zip.
I know that there are many example in the forum, but I want to understand (at least a bit) the script' s language.
I made button, Lclick expand the file Rclick compress.
Lclick code:

Code: Select all

run ""<xypath>\Data\Archiver\7z.exe" x -y -o<items>"
results: Error overflow
What I'm doing wrong?
Thanks in advantage and sorry for my poor english

Re: Please, help me understand

Posted: 31 Mar 2016 16:23
by highend
Bad quoting and <items> exists only in a different context...

Try this:

Code: Select all

run """<xypath>\Data\Archiver\7z.exe"" x -y -o<selitems>";

Re: Please, help me understand

Posted: 31 Mar 2016 16:43
by rinox
It doesn't work, no error but no results... I' ll try to download the latest 7zip version.

Re: Please, help me understand

Posted: 31 Mar 2016 16:47
by highend
put a:

Code: Select all

step;
above that line (and indent the second line with e.g. 4 spaces!)

and show a screenshot of how that line is resolved by XY.

Re: Please, help me understand

Posted: 31 Mar 2016 16:51
by rinox
No way :cry:

Re: Please, help me understand

Posted: 31 Mar 2016 16:53
by highend
What is "no way"?...

Code: Select all

step;
    run """<xypath>\Data\Archiver\7z.exe"" x -y -o<selitems>";
Execute that and show a screenshot of the window that you'll get...

Re: Please, help me understand

Posted: 31 Mar 2016 17:02
by rinox
Ok, I tried all you suggest. At this point the problem maybe about write permission on the folder (servers os are always critical about that), I'll investigate further, by now I can only say thank you very much and sorry for my poor english (I'm Italian)

Re: Please, help me understand

Posted: 31 Mar 2016 17:12
by rinox
but it MUST work... if I open a command, it work

Re: Please, help me understand

Posted: 31 Mar 2016 17:15
by highend
Then please, post the screenshot^^

Re: Please, help me understand

Posted: 31 Mar 2016 17:24
by rinox
Screenshot:
screen.jpg
It say "current command (interpreted and resolved)" but nothing??!!??

Re: Please, help me understand

Posted: 31 Mar 2016 17:34
by highend
You don't give 7z.exe an archive to extract^^ and atm you're trying to extract nothing to the name of the file^^

Explain exactly what you are trying to do. Give meaningful examples...

- Do you want to extract more than one file? If that's not the case you don't need <selitems> but <curitem>
- How exactly should the destination path look like?

E.g. this would extract all selected archives into folders that have the base names of their corresponding archive:

Code: Select all

run """<xypath>\Data\Archiver\7z.exe"" x <selitems> -y -o*";

Re: Please, help me understand

Posted: 31 Mar 2016 17:42
by rinox
I wold like to expand selected (one or more) archive into relative named new folder in the same dir and open that dir/s in another tab/s

Re: Please, help me understand

Posted: 31 Mar 2016 17:44
by rinox
THANK YOUUUUU :P :P :P :P :P :P :P

Re: Please, help me understand

Posted: 31 Mar 2016 18:33
by highend

Code: Select all

    $folders = "";
    foreach($file, "<selitems |>") {
        run """<xypath>\Data\Archiver\7z.exe"" x ""$file"" -y -o*";
        $folders = $folders . "<curpath>\" . gpc($file, "base") . "|";
    }
    foreach($folder, $folders, , "e") { tab("new", $folder); }