Visual folder
Visual folder
This script will automatically detect the position of an item (detached or not) relatively from the actual screen, and then apply it to a folder.
You need to run it from the long click menu. (It will detect if the item is a folder or not)
The data is saved and applied once.
Instructions:
– Copy paste this script, check the ‘show in item menu’
– Place an item (not a folder) and change their size as you want, relative to the screen itself, not the desktop (you can be far away from the main page)
– Run the script. The position/size will be saved.
– Run the script in a folder. Apply.
(- Now you can delete the previous item if you want.)
{Improved thanks to TBog suggestion}
———————————–
var item = LL.getEvent().getItem();
var desk = LL.getEvent().getContainer() || LL.getCurrentDesktop();
if(item.getType()==”Folder”){
if(!(“visualFolder” in self)){alert(“No data found\nYou need to run the script from a non-folder first to save data”); return;}
if(!confirm(“Folder detected. Would you like to apply the saved data?”) )return;
item.getProperties().edit().
setString(“f.wAH”,”CUSTOM”).
setString(“f.wAV”, “CUSTOM”).
setInteger(“f.wX”, self.visualFolder[0] ).
setInteger( “f.wY”, self.visualFolder[1] ).
setInteger( “f.wW”, self.visualFolder[2] ).
setInteger( “f.wH”, self.visualFolder[3] ).
commit();
Android.makeNewToast(“Data applied”,false).show();
}else{
self.visualFolder=[];
self.visualFolder[0] = item.getPositionX()-desk.getPositionX();
self.visualFolder[1] = item.getPositionY()-desk.getPositionY();
self.visualFolder[2] = item.getWidth()*item.getScaleX();
self.visualFolder[3] = item.getHeight()*item.getScaleY();
Android.makeNewToast(“Saved data. Run the script on a folder to apply”,false).show();
}
]]>
< ![CDATA[
I would suggest keeping all data related to a script in one variable as to minimize other scripts overwriting each other’s info by mistake.
]]>
< ![CDATA[
Bogdan Tautu You are totally rigth.
I made this when I discover the ‘self’ feature…thanks 🙂
]]>
< ![CDATA[
This is so coooooOOOOOOooooool!
]]>
< ![CDATA[
Whoooo… Amazing: simple idea but brilliant !
]]>
< ![CDATA[
oh shit that can come in real handy. cant wait to dive into scripting some more. I am working my way around tasker first. after that scripting comes first
]]>
< ![CDATA[
i cant find script editor anymore to even try
]]>
< ![CDATA[
wait did someone say tasker? GET IN MY HANGOUTS NOW hehe i wanna learn tasker
]]>
< ![CDATA[
Curtis Sylvester Jr. The script editor is like an app. It is shown in the app drawer. As usual, try refreshing it.
]]>
< ![CDATA[
i had the same thing. didnt get it back until the last update. even after i reinstalled my phone. The only thing i didnt try was to sign out of beta or alpha and re-join
]]>
< ![CDATA[
i had to reformat my tablet when i reinstalled llx the editor disappeared
]]>
< ![CDATA[
Very cool
]]>
< ![CDATA[
ok i found out why i didnt get the alpha/beta version when i reinstalled after my reformat. aparently i had to relog as a tester because when i reformatted google lost record. 5minutes after relogging as a tester i got the update
]]>
< ![CDATA[
Excellent work, thanks.
]]>