Page 1 of 1

Custom button concatenate commands and menu

Posted: 03 Apr 2016 10:39
by rinox
Hi, I've have a dopdown menu with this code:

Code: Select all

$items = getinfo("SelectedItemsPathNames","<crlf>");
     writefile("<xypath>\Data\Archiver\listfile.7ztd", $items);

"Espandi" run """<xypath>\Data\Archiver\7z.exe"" x <selitems> -y -o*";
-
"Crea zip" run """<xypath>\Data\Archiver\7za.exe"" a -tzip -mx9 test.zip @<xypath>\Data\Archiver\listfile.7ztd";
"Crea 7zip + veloce" run """<xypath>\Data\Archiver\7za.exe"" a -t7z -mx3 test7zmx3.7z @<xypath>\Data\Archiver\listfile.7ztd";
"Crea 7zip + piccolo" run """<xypath>\Data\Archiver\7za.exe"" a -t7z -mx9 test7zmx9.7z @<xypath>\Data\Archiver\listfile.7ztd";
I would like to do all automatically without first make the file list, EX:

Code: Select all

"Create zip"  $items = getinfo("SelectedItemsPathNames","<crlf>"); &&  writefile("<xypath>\Data\Archiver\listfile.7ztd", $items) && run """<xypath>\Data\Archiver\7za.exe"" a -tzip -mx9 test.zip @<xypath>\Data\Archiver\listfile.7ztd";
Of course the code is not working... please help me to find the right way, thank you all

Re: Custom button concatenate commands and menu

Posted: 03 Apr 2016 12:08
by highend
Sorry, I don't understand...

You want to create an archive from a list of files by giving 7z a filename (which is the list file and contains all files), without creating that listfile first???

Re: Custom button concatenate commands and menu

Posted: 03 Apr 2016 15:25
by rinox
Sorry for the previous post (going crazy maybe), I finally done what I looked for:

Code: Select all

"Crea zip" $items = getinfo("SelectedItemsPathNames","<crlf>");
     writefile("<xypath>\Data\Archiver\listfile.7ztd", $items);
     run """<xypath>\Data\Archiver\7za.exe"" a -tzip -mx9 test.zip @<xypath>\Data\Archiver\listfile.7ztd";
-
"Espandi archivi selezionati" $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); }
Now I'm trying to delete the "listfile.7ztd" once files are archived (ahk cmd ex: runwait) but really I don't know if needed... I think writefile() overwrite existent file...... or not?
Anyway there's a way to run an executable hidden or minimized (7z cmd)?

Re: Custom button concatenate commands and menu

Posted: 03 Apr 2016 15:44
by highend
I'm trying to delete the "listfile.7ztd" once files are archived

Code: Select all

run """<xypath>\Data\Archiver\7za.exe"" a -tzip -mx9 test.zip @<xypath>\Data\Archiver\listfile.7ztd", <curpath>, 1;
I think writefile() overwrite existent file...... or not?
It does by default
Anyway there's a way to run an executable hidden or minimized (7z cmd)?
Hidden: runret()

Alternative:
run command, [directory], [wait=0], [show=1]

Try 0 or 2 for the show value

Re: Custom button concatenate commands and menu

Posted: 03 Apr 2016 15:54
by rinox
As expert audiophile I can say you are "Esoteric" (much more the highend) :appl: