Inspired by James Coyle​: Containercopy

Inspired by James Coyle​: Containercopy

This script copies a panel or folder with all the items in there. It does not copy any styles.

New Panel/Folder is always created at 0/0.

How to use: run from panel or folder.

]]>

3 Commentsto Inspired by James Coyle​: Containercopy

  1. Anonymous says:

    < ![CDATA[

    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


    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);

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Thanks Lukas Morawietz​ this will be very useful.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *