In short; I need a script that will zip up all the select files to one user specified zip file. I started with this simple script:
input $n, "Enter the NAME and LOCATION of Archive file";
run "C:\Program Files\7-Zip\7z.exe" "a" "-tzip" "$n" <selitems>, , 1;
But If I have too many files selected the command line becomes too long and it will not execute. So I thought I would run it separately for each file that was selected and I did it like this:
input $n, "Enter the NAME and LOCATION of Archive file";
$filelist = getinfo('SelectedItemsPathNames', '|'); //collect list of selected files
$count = 1;
$filename=gettoken($filelist,$count,"|"); //get first filename from filelist
$stop = 1;
while($stop == 1)
{
run "C:\Program Files\7-Zip\7z.exe" "a" "-tzip" "$n" "$filename", , 1;
$count++; // add number to count
$filename=gettoken($filelist,$count,"|"); // get next filename from filelist
if("$filename"==""){$stop == 2;} // if end of list break out of while loop
} // end while
The problem with this is that now it will start the next instance of adding to the zip file before the last instance was done. Thus only some of the files get added while others error out.
7zip does have exit codes that I thought maybe I could have it pause until the exitcode equaled something. But XYplorer doesn't have a way to see what the system variable %errorcode% is.
I'm a novice scripter so please be kind.
XYplorer Beta Club