Hi mithrin
In reply to your post . I had been using it and had found no problems.
So I did some extensive testing . one problem I found was I mainly use win7.
As a result I have no spaces in my paths .
This is where it gets interesting trying to find work arounds for XP.
I found that paths to 7z.exe could not contain spaces (wasn't clever with dots either).
This is the script I found worked in XP and win7 as long as the caveat was adhered to.
Code: Select all
"_Initialize";
// this has been tested on win7 64bit and XP
// Please make sure that path to 7z.exe does not contain spaces
perm $p_zip = "C:\TEMP\New_Folder\7-Zip\7z.exe";
perm $p_ZipFM = "C:\TEMP\New_Folder\7-Zip\7zFM.exe";
perm $p_note = """C:\Documents and Settings\Administrator\My Documents\ConTEXT\ConTEXT.exe""";
"&Open <curname> : open"
openwith "$p_ZipFM";
-
"&List all this folder "
selfilter "*.rar ; *.7z ; *.cab ; *.gz ; *.zip";
$SelectedItems = get("SelectedItemsNames", "|");
foreach($Item, $SelectedItems, "|") {
Run("cmd /c $p_zip l ""$Item"" >> ""<curfolder>.txt""");
wait 500;
}
"List <curname> single"
Run("cmd /c $p_zip l ""<curitem>"" >""<curitem>.txt"" " );
-
"7-Zip and move into <curbase>.&7z and move : 7z"
$a = get("path", i);
openwith """$p_zip"" a -t7z ""$a\<curbase>.7z""";
"Zip and move into <curbase>.&zip and move : zip"
$a = get("path", i);
openwith """$p_zip"" a -tzip ""$a\<curbase>.zip""";
-
"Compress into <curbase>.&zip : zip"
focus;
#113;
focus;
$curbase= <clipboard>;
$l = strlen ($curbase);
$p = strpos ($curbase, <crlf>);
$curbase = regexreplace ($curbase, "^-1$", "$l");
if ($p = "-1") { $p = $l ; }
$curbase = substr ($curbase, 0, $p);
$curbase = replace ($curbase," ","_");
set $curbase, "$curbase.zip";
//Compress file with .zip. Name= base of file.
openwith """$p_zip"" a -tzip ""$curbase""" ;
"Compress into <curbase>.&7z : 7z"
focus;
#113;
focus;
$curbase= <clipboard>;
$l = strlen ($curbase);
$p = strpos ($curbase, <crlf>);
$curbase = regexreplace ($curbase, "^-1$", "$l");
if ($p = "-1") { $p = $l ; }
$curbase = substr ($curbase, 0, $p);
$curbase = replace ($curbase," ","_");
set $curbase, "$curbase.7z";
//Compress file with .zip. Name= base of file.
openwith """$p_zip"" a -t7z $curbase";
-
"&Extract contents of <curname> here (prompts) : ext"
openwith """$p_zip"" x "
"&Extract contents of <curname> to folder <curbase> (overwrite NO warning) : extf"
openwith """$p_zip"" x -y -o* <items>"
"&Extract contents of <curname> to other pane (overwrite NO warning) : extop"
$a = get("path", i);
openwith """$p_zip"" x -y -o""$a"" ""<items>""" ;
"&Extract contents of <curname> to <curbase> other pane (overwrite NO warning) : extfop"
$a = get("path", i);
openwith """$p_zip"" x -y -o""$a\<curbase>\"" <items>" ;
"&Extract contents of <curname> here w renumber existing : extre"
//Extract content to folder Name= base of zip. aot= If files exist, autonumber new files.
openwith """$p_zip"" x -aot"
"&Extract contents of <curname> to folder <curbase> w renumber existing : extfre"
openwith """$p_zip"" x -y -o* -aot <items>"
"&Extract contents of <curname> to other pane w renumber existing : extopre"
$a = get("path", i);
openwith """$p_zip"" x -y -o""$a"" -aot <items>" ;
"&Extract contents of <curname> to other pane w renumber archive file : extopra"
$a = get("path", i);
openwith """$p_zip"" x -y -o""$a"" -aou <items>" ;
"&Extract contents of <curname> to <curbase> other pane w renumber archive file : extfopra"
$a = get("path", i);
openwith """$p_zip"" x -y -o""$a\<curbase>\"" -aou <items>" ;
-
"Compress into <curbase>.zi&p (password protection) : pzip"
focus;
#113;
focus;
$curbase= <clipboard>;
$l = strlen ($curbase);
$p = strpos ($curbase, <crlf>);
$curbase = regexreplace ($curbase, "^-1$", "$l");
if ($p = "-1") { $p = $l ; }
$curbase = substr ($curbase, 0, $p);
$curbase = replace ($curbase," ","_");
set $curbase, "$curbase.zip";
$i = input (Input password for zipfile, password);
//Compress with .zip and password protect archive.
openwith """$p_zip"" a -tzip $curbase -p$i"
"Compress into <curbase>.7z (password protection) : p7z"
focus;
#113;
focus;
$curbase= <clipboard>;
$l = strlen ($curbase);
$p = strpos ($curbase, <crlf>);
$curbase = regexreplace ($curbase, "^-1$", "$l");
if ($p = "-1") { $p = $l ; }
$curbase = substr ($curbase, 0, $p);
$curbase = replace ($curbase," ","_");
set $curbase, "$curbase.7z";
$i = input (Input password for zipfile, password);
//Compress with 7z and password protect and encrypt archive headers.
openwith """$p_zip"" a -t7z $curbase -p$i -mhe"
"?Set Password to <curname> zip : zp"
set $file, <curbase>;
openwith """$p_zip"" x -y ""<items>""" ;
msg "wait until extract",1;
focus;
filter $file*;
wait 1000 ;
delete 0, 0 ;
sortby created, d;
sel 1;
sub pzip;
filter $file;
"?Set Password to <curbase> .7z : z7"
set $file, <curbase>;
openwith """$p_zip"" x -aou ""<items>""";
msg "wait until extract",1;
focus;
filter $file*;
wait 1000 ;
delete 0, 0 ;
sortby created, d;
sel 1;
sub p7z;
filter $file;
-
"Edit script : edit"
$ScriptFile = self ("file");
run $p_note """$ScriptFile""" , w;
-
"Cancel"
"_Terminate";
// unset $p_ZipFM;
// unset $p_zip;
// unset $p_note;
please dont be afraid to ask if there are any problems. As you can tell I enjoy the challenge.
I apologize for the delay in responding due to being unwell and all the testing it took.
Also added a couple more extracts and titled others differently.
totmad1 (totally mad one)