Label Case switcher

Label Case switcher

Just a fast script that will change the labels of all the items in the app drawer (or a custom container if necessary, ask about)

The change can be done permanently or just visual (a restart will change them back)

Available types: ( you can write your own one if you know scripting)

– UPPER CASE

– lower case

– Sentence case

– Title Case (from http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript)

(Note: sorry for the lack of posts, in fact I have a lot of scripts I’m working on, but my free time has decrease suddenly, maybe in summer)

———————————————–

var container = LL.getContainerById(99);//LL.getEvent().getContainer();

var permanent = confirm(“Permanent change?”);

var type = parseInt(prompt(“1- UPPER CASE\n2- lower case\n3- As a sentence\n4- Title Case”,0));

run(container);

Android.makeNewToast(“Done”,true).show();

function run(cont){

var items = cont.getItems();

for(var i=items.getLength()- 1;i>=0; –i){

var item=items.getAt(i);

item.setLabel(change(item.getLabel()),permanent);

if(item.getType()==”Folder”||item.getType()==”Panel”)run(item.getContainer());

}

}

function change(label){

var ret=label;

switch(type){

case 1: ret=ret.toUpperCase(); break;

case 2: ret=ret.toLowerCase(); break;

case 3: ret=

ret.charAt(0).toUpperCase() + ret.substring(1,ret.length).toLowerCase(); break;

case 4: ret=ret.split(” “).map(function(i){return i[0].toUpperCase() + i.substring(1)}).join(” “);

break;

//Write here your custom label changer

}

return ret;

}

]]>
« (Previous Post)
(Next Post) »

4 Commentsto Label Case switcher

  1. Anonymous says:

    < ![CDATA[

    Nice one!

    ]]>

  2. Anonymous says:

    < ![CDATA[

    can u use this to change the Hole script active panel label from “holes” to deactive state? 😈

    ]]>

  3. Anonymous says:

    < ![CDATA[

    This one? No sorry.


    But it’s easy to write a custom one. Better talk in the hole script post.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    yea thats what i figured, the idea was the hidden gem in this one 🙂

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *