K-Meleon

KMeleonWiki > Resources > MacroLibrary > KmmAutoFill

Submitted by: desga2



Notes:

This macro enable you to automatically enter a text that you frequently have to insert in anywhere you want to at the press of a button. This macro isn't recommended for store logins or passwords because this data isn't encryption and is very accesible. (For this you can use 'Remember passwords' option of K-Meleon)

Updated: Now works fine in 1.1.X & 1.5 versions




Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text file(s):

Auto-Fill.kmm

# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)

# ---------- Custom menu: Auto-Fill -------------------------------------------
#
# Dependencies        : -
# Resources        : -
# Preferences        : -
#
# -----------------------------------------------------------------------------

_AutoFill_Define_Text{
$_AutoFill_STRING=getpref(STRING, "user.preference.auto-fill.string");
statusbar("Default accelerate for Auto-Fill: F12");
$_AutoFill_VALUE=prompt("Insert Auto-Fill string:", "Define Auto-Fill string", $_AutoFill_STRING);
$_AutoFill_VALUE!=""? $_AutoFill_STRING=$_AutoFill_VALUE:0;
$_AutoFill_VALUE!=""? setpref(STRING, "user.preference.auto-fill.string", $_AutoFill_STRING):0;
}

_AutoFill_Define_Acc{
$_AutoFill_ACC_KEYS=getpref(STRING, "user.preference.auto-fill.acc_keys");
statusbar("Accelerate for Auto-Fill must be in KM format keys: VK_F12");
$_AutoFill_VALUE=prompt("Insert Auto-Fill accelerator keys:", "Auto-Fill Accel", $_AutoFill_ACC_KEYS);
$_AutoFill_VALUE!=""? $_AutoFill_ACC_KEYS=$_AutoFill_VALUE:0;
$_AutoFill_VALUE!=""? setpref(STRING, "user.preference.auto-fill.acc_keys", $_AutoFill_ACC_KEYS):0;
$_AutoFill_VALUE!=""? setaccel($_AutoFill_ACC_KEYS, "macros(AutoFill_Paste)"):0;
$_AutoFill_VALUE!=""? setaccel("VK_F12", NULL):0;
}

AutoFill_Paste{
$_AutoFill_TEXT=getclipboard();
$_AutoFill_STRING=getpref(STRING, "user.preference.auto-fill.string");
setclipboard($_AutoFill_STRING);
id(ID_EDIT_PASTE);
setclipboard($_AutoFill_TEXT);
}

# ----- PRIVATE

AutoFill_BuildMenu{
setmenu("Settings",popup,"A&uto-Fill");
setmenu("A&uto-Fill",macro,"&Define Auto-Fill text ...",_AutoFill_Define_Text);
setmenu("A&uto-Fill",macro,"&Define Auto-Fill accelerator ...",_AutoFill_Define_Acc);
$_AutoFill_VALUE=getpref(STRING, "user.preference.auto-fill.acc_keys");
$_AutoFill_VALUE!=""? setaccel($_AutoFill_VALUE, "macros(AutoFill_Paste)"): setaccel("VK_F12", "macros(AutoFill_Paste)");
}

$OnInit=$OnInit."AutoFill_BuildMenu;";

# -----------------------------------------------------------------------------
$macroModules=$macroModules."Auto-Fill;";


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.