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;
}
]]>
< ![CDATA[
Nice one!
]]>
< ![CDATA[
can u use this to change the Hole script active panel label from “holes” to deactive state? 😈
]]>
< ![CDATA[
This one? No sorry.
But it’s easy to write a custom one. Better talk in the hole script post.
]]>
< ![CDATA[
yea thats what i figured, the idea was the hidden gem in this one 🙂
]]>