quote:
Originally posted by MenthiX
code:
if(CommandIs == "Caps") {
return Message.replace(Message, Message.toUpperCase());
}
The above code transforms it to uppercase, so i assume adding the following directly below that code will give you a transform it to all lowercase:code:
if(CommandIs == "Lower") {
return Message.replace(Message, Message.toLowerCase());
}
I'm sorry but that can be done better, just try this:
code:
if(CommandIs == "Caps") return Message.toUpperCase();
and for lowercase:
code:
if(CommandIs == "Lower") return Message.toLowerCase();
It is just nicer to use these one liners (as well as being quicker). Realistically the code of the script could be better, but this is sufficient for the script as it is.
Oh and just so you know, it is perfectly fine to not use {} for an if statement when there is only one line for inside of it.
quote:
Originally posted by MenthiX
And to make it work in the menu, search for:
code: if(ControlId == "Caps") {
var CommandIs = "Caps";
new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
}
Ande directly under that add:
code: if(ControlId == "Lower") {
var CommandIs = "Lower";
new ActiveXObject('WScript.Shell').RegWrite(MsgPlus.ScriptRegPath + Email + "\\command",CommandIs);
}
This isn't correct. This is for the radio controls in the menu but you will have to personally edit the XML to add these.... The script itself only has "options" and "About" in the menu.
PS. Sorry MenthiX for disassembling your post how I did, but I wanted to make sure all the correct and best information was given, I hope you don't mind too much, it wasn't my intention.