User Tools

Site Tools


script_copy_container

**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 : This script copies folders and panels with all their items, but without any styles. * Author : [[https://plus.google.com/+LukasMorawietz|LM13]] * Current Version : 1.0 ====== Changelog ====== * Version 1.0 (8/3/2015): initial release in wiki ====== How to use the script ====== * Run from a panel or folder. It will be copied to 0/0. ====== Issues and Hints ====== * untested with widgets and subcontainers //please report all bugs in the g+ community!// ====== Script ====== <sxh javascript;>var e=LL.getEvent(); var i=e.getItem(); var c; if(i==null) { c=e.getContainer(); i=c.getOpener(); } else c=i.getContainer(); var t=i.getType(); if(t!="Folder"&&t!="Panel")return; var d=LL.getCurrentDesktop(); var newI=(t=="Folder")?d.addFolder(i.getLabel(),0,0):d. addPanel(0,0,i.getWidth(),i. getHeight()); var newC=newI.getContainer(); if(t=="Folder")newI.open(); setTimeout(function(){ var items=c.getItems(); for(var x=0;x<items.length;x++){ var item=items.getAt(x); var newItem= newC.addShortcut(item.getLabel(),item.getIntent(),0,0); newItem.getProperties().edit().setBoolean("i.onGrid",false).commit(); newItem.setScale(item.getScaleX(),item.getScaleY()); newItem.setRotation(item.getRotation()); newItem.setPosition(item.getPositionX(),item.getPositionY()); LL.save(); newItem.setDefaultIcon(item.getDefaultIcon()); if(item.getProperties().getBoolean("i.onGrid")){ newItem.getProperties().edit().setBoolean("i.onGrid",true).commit(); var r=item.getCell(); newItem.setCell(r.getLeft(),r.getTop(),r.getRight(),r.getBottom()); LL.save(); } } },100); </sxh>

script_copy_container.1425825925.txt.gz · Last modified: 2015/03/08 14:45 by lm13