Luys
There are two files needed plus 7-Zip must be installed. There is a macro (kmm) and a javascript (js) which I place in the macros folder in my profile. Since I need access to files usually held by K-Meleon when it is running, the method is to run the macro and exit KM. Upon exit the js file runs and creates a 7z file. To import one only needs to use 7-Zip to extract the information into the KM profile. Again this step is done when KM is not running.
These are the files for KM 74x-75x.
ResLogins.kmm
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
#
# ---------- ResLogins.kmm
# ---------- K-Meleon Macro Language make an external of logins KM74x as a 7-Zip file --
#
# Dependencies : main.kmm
# Resources : ResLogins.js
# Preferences : -
# Version : 1.0 2014-04-18
# --------------------------------------------------------------------------------------
ResLogins_RunCode {
$_ResLogins_Cur_Profile_Path = getfolder(ProfileFolder);
$_ResLogins_Reserve_Path = promptforfolder( "Select a folder for your Reserve Profile.\nIt is best to make a separate folder.\nThe folder does not need to be within K-Meleon." , getfolder(RootFolder) );
$_ResLogins_Reserve_Path ==""? &_ResLogins_Cancel : &_ResLogins_ValidateNotSameFolder;
}
# PRIVATE --------------
# set global variables
$_ResLogins_Staged_Flag = false;
$_ResLogins_Cur_Profile_Path = "dummy" ;
$_ResLogins_Reserve_Path = "dummy" ;
_ResLogins_Cancel {
$_ResLogins_Button=confirm("Did you mean to cancel?","Affirm cancel" ,YESNO,QUESTION);
$_ResLogins_Button == "YES" ? 0 : &_ResLogins_RunCode ;
}
_ResLogins_ValidateNotSameFolder {
$_ResLogins_Cur_Profile_Path == $_ResLogins_Reserve_Path ? &_ResLogins_ReDo : &_ResLogins_Staged ;
}
_ResLogins_ReDo {
alert("Target of copy should not be\n\nthe profile folder.","Copy to itself",EXCLAIM);
&_ResLogins_RunCode ;
}
_ResLogins_Staged {
$_ResLogins_Staged_Flag = true ;
}
_ResLogins_ExitRun {
$_ResLogins_Staged_Flag == true ? exec("wscript.exe \"".$_ResLogins_Path."\" \"".$_ResLogins_Cur_Profile_Path."\" \"".$_ResLogins_Reserve_Path."\"") : 0 ;
}
_ResLogins_BuildMenu{
setmenu("&Tools",macro,"Export Logins as 7z",ResLogins_RunCode, Misc);
}
_ResLogins_GetPath{
### ResLogins.js is supposed to be located in the same folder as ResLogins.kmm (this file).
### If it isn't, Windows Script Host will notify the user.
### Double underscore makes variable local only.
$__Data=readfile(getfolder(MacroFolder)."\\ResLogins.kmm");
$_ResLogins_Path=getfolder($__Data==""?UserMacroFolder:MacroFolder)."\\ResLogins.js";
}
$OnQuit=$OnQuit."_ResLogins_ExitRun;";
$OnStartup=$OnStartup."_ResLogins_GetPath;";
$OnInit=$OnInit."_ResLogins_BuildMenu;";
$macroModules=$macroModules."ResLogins;";
ResLogins.js
/* ResLogins.js by JamesD, version 1.0 2014-04-18
This script is a helper application for the K-Meleon Macro Module ResLogins.kmm that
enables you to make a reserve ( backup ) copy of the files which make up your Logins.
WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version of WSH is
available at http://msdn.microsoft.com/scripting/
*/
var Current_Logins_Path = WScript.Arguments(0); /* PROFILE PATH */
var Reserve_Logins_Path = WScript.Arguments(1); /* OUTPUT PATH (WORKING DIRECTORY) */
var WshShell = new ActiveXObject("WScript.Shell");
var Logins27z_Outfile = Reserve_Logins_Path+"\\KMlogins.7z" ;
var Logins27z_db = Current_Logins_Path + "\\key3.db" ;
var Logins27z_sql = Current_Logins_Path + "\\signons.sqlite" ;
WScript.Sleep( 2000) ;
var oExec = WshShell.Exec("C:\\Program Files\\7-Zip\\7zG.exe a \""+Logins27z_Outfile+"\" \""+Logins27z_db+"\" -w\""+Reserve_Logins_Path+"\"") ;
while (oExec.Status == 0)
{
WScript.Sleep(100);
}
WScript.Echo("One of two operations complete");
var oExec = WshShell.Exec("C:\\Program Files\\7-Zip\\7zG.exe a \""+Logins27z_Outfile+"\" \""+Logins27z_sql+"\" -w\""+Reserve_Logins_Path+"\"") ;
while (oExec.Status == 0)
{
WScript.Sleep(100);
}
WScript.Echo("Two of two operations complete");
These are the files for KM76x.
ResLogins76.kmm
# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage2)
#
# ---------- ResLogins76.kmm
# ---------- K-Meleon Macro Language
# ---------- Make an external file of logins for KM76 as a 7-Zip file ---
# ---------- Use this version only if logins saved natively in a json file ---
#
# Dependencies : main.kmm
# Resources : ResLogins76.js
# Preferences : -
# Version : 1.5 2016-04-08
# ------------------------------------------------------------------------------------
ResLogins76_RunCode {
$_ResLogins76_Cur_Profile_Path = getfolder(ProfileFolder);
$_ResLogins76_Reserve_Path = promptforfolder( "Select a folder for your Reserve Profile.\nIt is best to make a separate folder.\nThe folder does not need to be within K-Meleon." , getfolder(RootFolder) );
$_ResLogins76_Reserve_Path ==""? &_ResLogins76_Cancel : &_ResLogins76_ValidateNotSameFolder;
macros("ResLogins76_RunCodeP");
}
ResLogins76_RunCodeP {
$_ResLogins76_Reserve_Pswd = prompt("Enter a password for 7-Zip output file", "Password for Logins");
$_ResLogins76_Reserve_Pswd == ""? &_ResLogins76_CancelP : 0;
}
# PRIVATE --------------
# set global variables
$_ResLogins76_Staged_Flag = false;
$_ResLogins76_Cur_Profile_Path = "dummy" ;
$_ResLogins76_Reserve_Path = "dummy" ;
_ResLogins76_Cancel {
$_ResLogins76_Button=confirm("Did you mean to cancel?","Affirm cancel" ,YESNO,QUESTION);
$_ResLogins76_Button == "YES" ? 0 : &_ResLogins76_RunCode ;
}
_ResLogins76_CancelP {
$_ResLogins76_ButtonP=confirm("Do you mean to NOT TO USE a password?","Affirm no password" ,YESNO,QUESTION);
$_ResLogins76_ButtonP == "YES" ? $_ResLogins76_Reserve_Pswd="$none$" : &ResLogins76_RunCodeP ;
}
_ResLogins76_ValidateNotSameFolder {
$_ResLogins76_Cur_Profile_Path == $_ResLogins76_Reserve_Path ? &_ResLogins76_ReDo : &_ResLogins76_Staged ;
}
_ResLogins76_ReDo {
alert("Target of copy should not be\n\nthe profile folder.","Copy to itself",EXCLAIM);
&_ResLogins76_RunCode ;
}
_ResLogins76_Staged {
$_ResLogins76_Staged_Flag = true ;
}
_ResLogins76_ExitRun {
$_ResLogins76_Staged_Flag == true ? exec("wscript.exe \"".$_ResLogins76_Path."\" \"".$_ResLogins76_Cur_Profile_Path."\" \"".$_ResLogins76_Reserve_Path."\" \"".$_ResLogins76_Reserve_Pswd."\"") : 0 ;
}
_ResLogins76_BuildMenu{
setmenu("&Tools",macro,"Export Logins as 7z",ResLogins76_RunCode, Misc);
}
_ResLogins76_GetPath{
### ResLogins.js is supposed to be located in the same folder as ResLogins.kmm (this file).
### If it isn't, Windows Script Host will notify the user.
### Double underscore makes variable local only.
$__Data=readfile(getfolder(MacroFolder)."\\ResLogins.kmm");
$_ResLogins76_Path=getfolder($__Data==""?UserMacroFolder:MacroFolder)."\\ResLogins76.js";
}
$OnQuit=$OnQuit."_ResLogins76_ExitRun;";
$OnStartup=$OnStartup."_ResLogins76_GetPath;";
$OnInit=$OnInit."_ResLogins76_BuildMenu;";
$macroModules=$macroModules."ResLogins76;";
ResLogins76.js
/* ResLogins76.js by JamesD, version 1.5 2016-04-08
This script is a helper application for the K-Meleon Macro Module ResLogins.kmm that
enables you to make a reserve ( backup ) copy of the files which make up your Logins.
Use this with ResLogins76.kmm if your logins are saved natively in a json file
WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version of WSH is
available at http://msdn.microsoft.com/scripting/
*/
var Current_Logins_Path = WScript.Arguments(0); /* PROFILE PATH */
var Reserve_Logins_Path = WScript.Arguments(1); /* OUTPUT PATH (WORKING DIRECTORY) */
var Reserve_Logins_Pswd = WScript.Arguments(2); /* OUTPUT FILE PASSWORD */
var WshShell = new ActiveXObject("WScript.Shell");
var Logins27z_Outfile = Reserve_Logins_Path+"\\KMlogins76.7z" ;
var Logins27z_db = Current_Logins_Path + "\\key3.db" ;
var Logins27z_json = Current_Logins_Path + "\\logins.json" ;
var Logins27z_pswd = Reserve_Logins_Pswd ;
WScript.Sleep( 2000) ;
if (Reserve_Logins_Pswd == "$none$") {
var oExec = WshShell.Exec("C:\\Program Files\\7-Zip\\7zG.exe a \""+Logins27z_Outfile+"\" \""+Logins27z_db+"\" -w\""+Reserve_Logins_Path+"\"");
} else {
var oExec = WshShell.Exec("C:\\Program Files\\7-Zip\\7zG.exe a \""+Logins27z_Outfile+"\" \""+Logins27z_db+"\" -w\""+Reserve_Logins_Path+"\" -p\""+Logins27z_pswd+"\"");
}
while (oExec.Status == 0)
{
WScript.Sleep(100);
}
WScript.Echo("One of two operations complete");
if (Reserve_Logins_Pswd == "$none$") {
var oExec = WshShell.Exec("C:\\Program Files\\7-Zip\\7zG.exe a \""+Logins27z_Outfile+"\" \""+Logins27z_json+"\" -w\""+Reserve_Logins_Path+"\"");
} else {
var oExec = WshShell.Exec("C:\\Program Files\\7-Zip\\7zG.exe a \""+Logins27z_Outfile+"\" \""+Logins27z_json+"\" -w\""+Reserve_Logins_Path+"\" -p\""+Logins27z_pswd+"\"");
}
while (oExec.Status == 0)
{
WScript.Sleep(100);
}
WScript.Echo("Two of two operations complete");