User Tools

Site Tools


script_enable_disable

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== About the script ====== * Purpose : It lets you enable/disable script one by one * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/bTFEZSmv3Uw ====== How to use the script ====== Just run the script and click an element to enable/disable that script. If you prefer to show disabled script as checked ones, change the ck parameter in the first line of the script. Remember: when you open a script in the script editor it is automatically enabled. ====== Script code ====== <sxh javascript> 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<list.getLength();++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(); </sxh>

script_enable_disable.1432995132.txt.gz · Last modified: 2015/05/30 14:12 by trianguloy