Creating Custom Macros
Posted by: Ominx
Date: November 19, 2001 05:46AM

I'm trying to create a macro that will toggle java and javascript on and off. So far, this is what I have for the javascript macro:

javascript {
menu = Java Script
togglepref(INT, javascript.enabled, 0, 1)
}

This is not working and I was hoping for some ideas. Also, I am trying to create a menu for "Security" but it won't show up. This is what I have:

&Security {
macros(javascript)
macros(java)
}

I currently have 7 different menus, one of them is a custon "Email" menu I created without any problem. Am I limited to the number of menu listings I can have?

Any help would be appreciated. If I can get this straightened out, I will be even more amazed by the customization possibilities of K-Meleon. Thanks.

Re: Creating Custom Macros
Posted by: Jeff
Date: November 19, 2001 06:05AM

javascript.enabled is a boolean value, so you need to use
togglepref(bool, javascript.enabled, 0, 1)


Make sure you declare you &Security sub menu before the menu you are including it in. Also, make sure you specify it as &Security (with the ampersand) in the menu you're using it with.

-- Jeff

Re: Creating Custom Macros
Posted by: po
Date: November 19, 2001 06:14AM

the preference "javascript.enabled" wants a boolean value (true/false), not an integer... try it that way and see if it works.

as for the menu, did you define it above the main menu, and then add it's name to the main menu definition? don't forget to include the "&" character in both places...

--- po

Re: Creating Custom Macros
Posted by: po
Date: November 19, 2001 06:20AM

oops... looks like i took to long to type all that. ya beat me to it. =)

sorry for the redundancy.

--- po

Re: Creating Custom Macros
Posted by: Ominx
Date: November 19, 2001 06:37AM

OK,

Got the menu, thanks.

But the macro still doesn't work. I used your suggestion and wrote:
javascript {
menu = JavaScript
togglepref(bool, javascript.enabled, true, false)

I also tried: togglepref(bool, javascript.enabled, 0, 1) as Jeff suggested. No luck either way. Anything else I can try?

Re: Creating Custom Macros
Posted by: po
Date: November 19, 2001 07:21AM

maybe try capitalizing the BOOL part?

dunno if that matters.

--- po

Re: Creating Custom Macros
Posted by: po
Date: November 19, 2001 08:49AM

ok...

i tried it myself, and couldn't get it to work either. i also tried setting it up as two seperate 'setpref()' macros, and that also didn't work... go figure.

some of the macro stuff is a little wonky yet, apparently.

--- po

K-Meleon forum is powered by Phorum.