What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » from caps to lowercase

from caps to lowercase
Author: Message:
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
O.P. from caps to lowercase
in this script http://www.msgpluslive.net/scripts/view/71-Message-Enchanter
you can change all the letters to caps but can i mod it to make all the letters lowercase?

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














05-23-2007 12:24 PM
Profile E-Mail PM Find Quote Report
Menthix
forum admin
*******

Avatar

Posts: 5537
Reputation: 102
40 / Male / Flag
Joined: Mar 2002
RE: from caps to lowercase
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());
    }

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 post was edited on 05-23-2007 at 12:35 PM by Menthix.
Finish the problem
Menthix.net | Contact Me
05-23-2007 12:31 PM
Profile E-Mail PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: from caps to lowercase
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.

This post was edited on 05-23-2007 at 01:24 PM by markee.
[Image: markee.png]
05-23-2007 01:15 PM
Profile PM Find Quote Report
Menthix
forum admin
*******

Avatar

Posts: 5537
Reputation: 102
40 / Male / Flag
Joined: Mar 2002
RE: from caps to lowercase
You're right. I just took a quick look at the source and modified only the very minimal needed :). It will add a radiobutton instead of menuitem indeed, there is no real need to add a menuitem.
Finish the problem
Menthix.net | Contact Me
05-23-2007 01:34 PM
Profile E-Mail PM Web Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: RE: from caps to lowercase
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());
    }

Can't you just do:
code:
if(CommandIs == "Caps") {
   return Message.toUpperCase();
}
4 8 15 16 23 42
05-23-2007 02:01 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: from caps to lowercase
quote:
Originally posted by vikke
Can't you just do:
code:
if(CommandIs == "Caps") {
   return Message.toUpperCase();
}

that's what markee said ;)



[OFFTOPIC] tbh, this script is not well written (like many others in the database). This is very unfortunate as scripts in the database are also quite often used as programming examples for beginning scripters. I know it is very hard, if not impossible todo, but it would be nice if there was a quality mark/scale added for scripts in the database. Of course this would be somewhat biased (because the mark should be given by only a few people, who know how to make proper code), but it would benefit the quality of the scripts in the database. This scale is not a public rating as imho public ratings (like it is now) don't say a thing about the quality of a script and extremely depend on the amount of downloads...... As it currently is: if a script has a bad rating, it even rates higher and is listed higher than a script with no rating.[/OFFTOPIC]

This post was edited on 05-23-2007 at 07:00 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
05-23-2007 06:56 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On