Development
: K-Meleon Forum
K-Meleon development related discussions.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=kko] @ndebord: Thank you for finally asking these questions! I think your examples are pretty good. This might be the beginning of a FAQ. I'll see what I can do... Related (in regard to km 1.5): [url=http://kmeleon.sourceforge.net/forum/read.php?1,80873]K-Meleon 1.1.6 and 1.5RC[/url] (JohnHell's post at the bottom of page 1 and the following post on page 2) Also: In the meantime there are quite a lot of custom macros for 1.1/1.5 available in the [url=http://kmeleon.sourceforge.net/wiki/MacroLibrary]MacroLibrary[/url]. [quote ndebord]So for example for executables: ---------------- macros.cfg AIM { menu = "AIM"; exec("C:\\AIM\\AIM.EXE"); } ---------------- menus.cfg - macros(AIM) - ------------------ accel.cfg %ifplugin macros ALT A = macros(AIM) %endif ------------------[/quote] First open "Edit" > "Configuration" > "User-Defined Macros". In case you get an error message that the folder is missing, open "Edit" > "Configuration" > "Profile Directory", create a new subfolder named "macros" and open it. Create a new text file and rename it to "<whateverYouLike>.kmm". Not "<whateverYouLike>.kmm.txt"! Best choose an application (editor) for kmm files (K-Meleon Macro Modules), so that you can open these files with a double click. In this case you may choose "AIM" or "Executables" as file name. The code could look like this: [code]AIM{ exec("C:\\AIM\\AIM.EXE"); } _AIM_BuildMenu{ setmenu("&Tools",macro,"AIM",AIM); } $OnInit=$OnInit."_AIM_BuildMenu;"; _AIM_SetAccels{ setaccel("ALT A","macros(AIM)"); } $OnInit=$OnInit."_AIM_SetAccels;";[/code] See also JujuLand's post. The most difficult part is the setmenu() statement: setmenu("&Tools",macro,"AIM",AIM); 1. parameter: "&Tools" - that is the name of the menu where you want to add your macro. You may want to choose a different menu, for instance a submenu of the Tools menu (examine \K-Meleon\defaults\settings\menus.cfg to learn what menus exist by default). By default, your item is added at the bottom of the chosen menu. This can be influenced - a lot of things can be influenced, but that's maybe a bit too difficult for the beginning. 2. parameter: macro - this is always the same for macros, it just tells km that this menu item is meant to call a macro. 3. parameter: "AIM" - this is the menu label, the text that will be displayed in the menu. You can choose a different name or add an access key ("&AIM" means that you can select the menu item by pressing Alt+A). 4. parameter: AIM - that is the name of the macro that the menu item is meant to call. Pay attention to the [url=http://kmeleon.sourceforge.net/wiki/MacroGuidelines]Macro Coding Guidelines[/url]! Choose unique names for your macros and (global) variables to avoid conflicts with macros in other kmm files. This is even more important in km 1.5 since it allows to redefine macros (if there exist several macros with the same name, no error will be issued, instead the macro that is parsed (loaded) last will be used).[/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development