User Tools

Site Tools


script_multi_container_bookmark

====== About the script ====== * Purpose : This script will make a script that will set the position of all panels inside the desktop/folder in wich it was launched. [Not very difficult to understand, but you need to know how functions work.] * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/KxhjoFxQ4iJ ====== How to use the script ====== Instructions: * Copy/paste this script as a new one. Check the 'Appear in ligthning menu' and/or 'item menu'. * Go to the desktop/folder, place all panels ( and the desktop/folder) as you want and run the script. [smoothly here means not instantly] * Copy the output script and paste it as a new one. Now you just need to launch that script. ====== Script code ====== <sxh javascript> var parent = LL.getEvent().getContainer() || LL.getCurrentDesktop(); if(parent.getId()==-1)parent=LL.getCurrentDesktop(); while( parent.getType()!="Desktop" && parent.getOpener().getType()!="Folder"){ parent = parent.getParent(); } function run(cont){ var str = "LL.getContainerById("+ cont .getId() + ").setPosition("+ cont .getPositionX()+","+ cont .getPositionY()+","+ cont .getPositionScale()+","+animations+");\n"; var items = cont.getItems(); for(var i=items.getLength()-1;i>=0;--i){ if(items.getAt(i).getType()=="Panel"){str+=run(items.getAt(i).getContainer() );} } return str; } var animations = confirm("Do you want to go smoothly? (not instantly)"); prompt("Script to use: Copy, paste and run",run(parent)); </sxh>

script_multi_container_bookmark.txt · Last modified: 2014/07/22 14:46 by trianguloy