#setmenu(<menuName>,<itemType>[,<itemName>[,<command>]][,<location>]); myOption_BuildMenu{ setmenu( "Edit", popup, "myOption", 5); } $OnInit=$OnInit."myOption_BuildMenu;";I need some help with this, can somebody provide me the right code to create an option called "myOption". It doesn't need to do anything. I'm just trying to understand how this works.
setmenu("_Config_General",popup,"Flash Switcher",5);Where I can find what '_Config_General' means, I know that is the menu, but where are those definitions?
Quote
Slayer
It would be great also if someone provides me a link with all those Global Variables that are part of the KM Interface. ie:_Config_General
This line is from the flashswitch file
setmenu("_Config_General",popup,"Flash Switcher",5);Where I can find what '_Config_General' means, I know that is the menu, but where are those definitions?
BTW: I can not make to work the dummy 'myOption' option. Do I need to change the &Edit to &Editor? The file appears in my list of Macros.
#setmenu(<menuName>,<itemType>[,<itemName>[,<command>]][,<location>]); myOption{ alert("this is a test","test" ,INFO); } myOption_BuildMenu{ setmenu( "&Edit", macro, "myOption",myOption, -1); } $OnInit=$OnInit."myOption_BuildMenu;"; $macroModules=$macroModules."myOption;";
#setmenu(<menuName>,<itemType>[,<itemName>[,<command>]][,<location>]); myOption{ alert("this is a test","test" ,INFO); } myOption_BuildMenu{ setmenu("&Edit",popup,"Hey",-1); setmenu( "Hey", macro, "myOption",myOption, -1); } $OnInit=$OnInit."myOption_BuildMenu;"; $macroModules=$macroModules."myOption;";
Quote
Slayer
I used 'macro' as a 2nd parameter in function 'setmenu'. I don't know if that is correct, but the code works.
Quote
disrupted
kmeleon default toolbar= also ie
Quote
desga2
Line "macroModules" add your macro file/module to the list of macros in the Macro Extension panel in Preferences. This allow to user disable it.
Quote
desga2
I don't know why but we forget documented it.
myOption{ alert("this is a test","test" ,INFO); } myOption_BuildMenu{ setmenu("&Edit",popup,"Hey",-1); setmenu( "Hey", macro, "Option1",myOption, -1); setmenu( "Hey", macro, "Option2",myOption, -1); setmenu( "Hey", macro, "Option3",myOption, -1); setmenu( "Hey", macro, "Option4",myOption, -1); } $OnInit=$OnInit."myOption_BuildMenu;"; $macroModules=$macroModules."myOption;";I was trying to get different options, but all of them do the same Alert. I only get 'option4'
_myOption1{ alert("this is a test1","test" ,INFO); } _myOption2{ alert("this is a test2","test" ,INFO); } _myOption3{ alert("this is a test3","test" ,INFO); } _myOption4{ alert("this is a test4","test" ,INFO); } myOption_BuildMenu{ setmenu("&Edit",popup,"Hey",-1); setmenu( "Hey", macro, "Option1", _myOption1, 1); setmenu( "Hey", macro, "Option2", _myOption2, 2); setmenu( "Hey", macro, "Option3", _myOption3, 0); setmenu( "Hey", macro, "Option4", _myOption4, 3); } $OnInit=$OnInit."myOption_BuildMenu;"; $macroModules=$macroModules."myOption;";
My original idea was not to trigger the same command, but reducing the code, using a loop. Since all the menus were calling a similar Procedure.Quote
desga2
Menus and buttons are diferenced by K-Meleon to command/macro (not by name), if K-Meleon macro found some button/menus items with identical command/macro for K-Meleon maro are the same button/menu entry and only one is showed.
(K-Meleon considered that duplicated is stupid and I too)
Quote
Slayer
My original idea was not to trigger the same command, but reducing the code, using a loop. Since all the menus were calling a similar Procedure.
_myOption{ $_opt = $ARG ; alert("This is the choice. " .$_opt, "test", INFO); } myOption_BuildMenu{ setmenu("&Edit",popup,"Hey",-1); setmenu( "Hey","macro","Option1","_myOption(1)"); setmenu( "Hey","macro","Option2","_myOption(2)"); setmenu( "Hey","macro","Option3","_myOption(3)"); setmenu( "Hey","macro","Option4","_myOption(4)"); } $OnInit=$OnInit."myOption_BuildMenu;"; $macroModules=$macroModules."myOption;";
That's excellent! Thanks. Is like working with arrays.Quote
JamesD
This code uses the $ARG statement. The code is smaller. You can make choice of what action to take based on value of $_opt.
_myOption{ $_opt = $ARG ; alert("This is the choice. " .$_opt, "test", INFO); } myOption_BuildMenu{ setmenu("&Edit",popup,"Hey",-1); setmenu( "Hey","macro","Option1","_myOption(1)"); setmenu( "Hey","macro","Option2","_myOption(2)"); setmenu( "Hey","macro","Option3","_myOption(3)"); setmenu( "Hey","macro","Option4","_myOption(4)"); } $OnInit=$OnInit."myOption_BuildMenu;"; $macroModules=$macroModules."myOption;";