User Tools

Site Tools


script_export_scripts

====== About the script ====== * Purpose : This script will export all your scripts to external storage/LightningLauncher/Scripts into text files * Author : [[https://plus.google.com/+LukasMorawietz|LM13]] * Current Version : 1.0 * Link : https://plus.google.com/102636094682779819959/posts/Sdk3NupN45b ====== Changelog ====== * Version 1.0 (14/9/2014): initial release in wiki ====== How to use the script ====== * Run from anywhere ====== Issues and Hints ====== * If you connect your device to pc using MTP and for some Filemanager you have to restart your phone to see the files. **//This Standalone Version is discontinued! Use [[script_multitool|Multitool]] instead, it's included there.//** //please report all bugs in the g+ community!// ====== Script ====== <sxh javascript;>//import Java Classes LL.bindClass("java.io.FileWriter"); LL.bindClass("java.io.File"); LL.bindClass("android.os.Environment"); //Directory to save scripts in var dir=new File(Environment.getExternalStorageDirectory()+File.separator+"LightningLauncher"+File.separator+"Scripts"+File.separator); dir.mkdirs();//create Directory if missing //Iterate through all scripts var scripts=LL.getAllScriptMatching(Script.FLAG_ALL); for(var a=0;a<scripts.length;a++) { var s=scripts.getAt(a); var file=new File(Environment.getExternalStorageDirectory()+File.separator+"LightningLauncher"+File.separator+"Scripts"+File.separator+s.getName()+".txt");//Define the file to save in file.createNewFile();//create the file //write the code to the file var f=new FileWriter(file); f.write(s.getText()); f.flush(); f.close(); } </sxh>

script_export_scripts.txt · Last modified: 2014/09/24 16:08 by lm13