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.

]]>

One Commentto General small utility that lets you enable/disable scripts one by one.

  1. Anonymous says:

    < ![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();

    ]]>

Leave a Reply

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