General small utility that lets you enable/disable scripts one by one.
General small utility that lets you enable/disable scripts one by one.
I personally used it when I needed to check if a script was taking long to load, instead of writing ‘return’ at the beginning.
For you to remember: when you open a script in the script editor it is automatically enabled.
]]>
< ![CDATA[
var ck=false;//if false, enabled scripts will be checked. If true, enabled scripts will be unchecked
//clases
LL.bindClass(“android.app.AlertDialog”);
LL.bindClass(“android.content.DialogInterface”);
//parameters
var list=LL.getAllScriptMatching(Script.FLAG_ALL);
var fd=Script.FLAG_DISABLED;
var states=[];
var names=[];
for(var t=0,tt=0;t
var s=list.getAt(t);
if(s.getId()==LL.getCurrentScript().getId()) continue;
states[tt]=s.hasFlag(fd)==ck;
names[tt]=s.getName();
++tt;
}
var builder=new AlertDialog.Builder(LL.getContext());
builder.setTitle((ck?”Disabled”:”Enabled”)+” scripts”);
builder.setMultiChoiceItems(names,states,new DialogInterface.OnMultiChoiceClickListener(){onClick:function(dialog,which,checked){
list.getAt(which).setFlag(fd,checked==ck);
}});
builder.setNeutralButton(“Close”,null);
builder.create().show();
]]>