Improvement requests :  K-Meleon Forum
Use this forum to talk about a feature you're missing.  
Auto-Fill or Macro to instert text -- Help
Posted by: Pierre
Date: October 07, 2007 11:48PM

I would like a macro string (or accelerator) that would enable me to automatically enter my email (or other text I frequently have to insert and for which I do not want to make mistakes) anywhere I want to at the press of a button.

Simple. No reason not to do it. If you know the string, please email me.

Thanks

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: desga2
Date: October 08, 2007 05:25AM

Try with this macro code!
Go to menu: Edit -> Configs -> User Macros
Create a new text file named Auto-Fill.kmm, open it with notepad (or similar) and paste this code;

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

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

Define_Text{
$STRING=getpref(STRING, "user.preference.auto-fill.string");
statusbar("Default accelerate for Auto-Fill: ALT+F");
$VALUE=prompt("Insert Auto-Fill string:", "Define Auto-Fill string", $STRING);
$VALUE!=""? $STRING=$VALUE:0;
$VALUE!=""? setpref(STRING, "user.preference.auto-fill.string", $STRING):0;
}

Define_Acc{
$ACC_KEYS=getpref(STRING, "user.preference.auto-fill.acc_keys");
statusbar("Accelerate for Auto-Fill must be in KM format keys: ALT F");
$VALUE=prompt("Insert Auto-Fill accelerator keys:", "Auto-Fill Accel", $ACC_KEYS);
$VALUE!=""? $ACC_KEYS=$VALUE:0;
$VALUE!=""? setpref(STRING, "user.preference.auto-fill.acc_keys", $ACC_KEYS):0;
$VALUE!=""? setaccel($ACC_KEYS, "macros(Paste_Text)"):0;
$VALUE!=""? setaccel("ALT F", NULL):0;
}

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

# ----- PRIVATE

AutoFill_BuildMenu{
setmenu("Settings",popup,"A&uto-Fill");
setmenu("A&uto-Fill",macro,"&Define Auto-Fill text ...",Define_Text);
setmenu("A&uto-Fill",macro,"&Define Auto-Fill accelerator ...",Define_Acc);
$VALUE=getpref(STRING, "user.preference.auto-fill.acc_keys");
$VALUE!=""? setaccel($VALUE, "macros(Paste_Text)"): setaccel("ALT F", "macros(Paste_Text)");
}


$OnInit=$OnInit."AutoFill_BuildMenu;";

# -----------------------------------------------------------------------------
$macroModules=$macroModules."Auto-Fill;";
Save changes and restart K-Meleon for changes take effect.

Now you have a new submenu named "Auto-Fill" in Tools menu.

Enjoy!



Edited 1 time(s). Last edit at 10/08/2007 05:33AM by desga2.

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: JujuLand
Date: October 08, 2007 03:27PM

Alt-F is not a good idea, it's by default the File menu shortcut.

A+


Mozilla/5.0 (x11; U; Linux x86_64; fr-FR; rv:24.0) Gecko/20140105 Ubuntu/12.04 K-Meleon/74.0

Web: http://jujuland.pagesperso-orange.fr/
Mail : alain [dot] aupeix [at] wanadoo [dot] fr




Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: desga2
Date: October 09, 2007 02:29AM

Quote
JujuLand
Alt-F is not a good idea, it's by default the File menu shortcut.
I'm sorry, it isn't by default the File (Archivo) menu shortcut or any other, in spanish. tongue sticking out smiley

You can change it if you like, it's free and easy. smiling smiley
(You can use "Define Auto-Fill accelerator ..." option)



Edited 1 time(s). Last edit at 10/09/2007 02:30AM by desga2.

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: Pierre
Date: October 19, 2007 11:51PM

Thanks for all that information. Would there be something simpler via accelerators?

For example a line like this in accel.cfg:

VK_F12 = Type "myemail@yahoo.ca`"

That one does not work obviously. Maybe you have suggestions.

Thanks for the marco. I will use it if there are no accelertor alternatives.

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: kko
Date: October 20, 2007 12:54AM

Nothing easier than that. You only need to modify the following line at the bottom of the macro:

$VALUE!=""? setaccel($VALUE, "macros(Paste_Text)"): setaccel("ALT F", "macros(Paste_Text)");

to:

$VALUE!=""? setaccel($VALUE, "macros(Paste_Text)"): setaccel("VK_F12", "macros(Paste_Text)");

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: Pierre
Date: October 26, 2007 01:00AM

Hi

Tried it but it does not work for the following reasons: I am using Pocket Kmeleon 1.02. The later version by Alain Aupeix (1.12) is highly instable with Vista. I really wish it did. So, I cannot upgrade to it (unless you know how to fix it).

1) There is no USER MACROS option. The EDIT>CONFIGURATION>MACROS gets you to the macros.cfg file.

I have tried copying & pasting the above macro at the bottom of the file but there blind links. When I start up Kmeleon, I get two error/conflict messages. If you need those, I could get you the exact text, one had to do with oninit or something like that?

Would creating a folder USER MACROS and adding the Auto-Fill.kmm file to it be a solution. If so, where do I create it exactly.

Or, is there a better solution?

Thanks.

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: desga2
Date: October 26, 2007 02:30AM

I could translate the code to old 1.02 macro language. Wait a few time i need do some tests.

K-Meleon in Spanish

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: desga2
Date: October 26, 2007 07:19PM

Remmember kmm files only work for 1.1x and later versions.
Below code is for 1.02 and before versions.

1) Go to menu: Edit -> Configuration -> Macros
Copy next code to end of file macros.cfg and save changes:
# ----- Auto-Fill macro extension:

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

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

2) Go to menu: Edit -> Configuration -> Menus
Search for 'Tools' in file menus.cfg, add the next bold line and save changes:
# ----- Tools

&Tools{
%ifplugin macros
:&Mail And News
-
: Page &Search
:&Web Search
:&Translate From
%else
&Web Search\tCtrl+G=ID_NAV_SEARCH
%endif
%ifplugin macros|privacy
-
:&Privacy
%endif
%ifplugin macros
: Pro&xy
:&User Agent
-
macros(AF_Define_Text,&Auto-Fill...)
macros(Hotlinks,&Hotlinks...)
macros(MGestures,Mouse &Gestures...)
-
macros(JSConsole,JavaScript &Console)
%endif
}

3) Go to menu: Edit -> Configuration -> Accelerators
Copy next code to end of file accel.cfg and save changes:
# Auto-Fill:
VK_F12 = macros(AutoFill)

- Restart K-Meleon for changes take effect. And now you have a new option in menu Tools 'Auto-Fill...' for define Auto-Fill string and you can use Auto-Fill push F12 key.

Greetings and enjoy!

K-Meleon in Spanish



Edited 1 time(s). Last edit at 10/26/2007 07:21PM by desga2.

Options: ReplyQuote
salut ciao parle 2 longue
Posted by: samir
Date: November 04, 2007 03:03AM

je suis un homme bien vrai amour pour des chose vrai relastion remontique amour vrai

Options: ReplyQuote
Re: Auto-Fill or Macro to instert text -- Help
Posted by: desga2
Date: November 04, 2007 04:26AM

Et moi aussi, samir, Et moi aussi.
You can search in I'm feeling by Google. Remmember, never married you!

K-Meleon in Spanish

Options: ReplyQuote


K-Meleon forum is powered by Phorum.