Looking for confirmation that what I want can be done and maybe a snippet showing the actual call.

Looking for confirmation that what I want can be done and maybe a snippet showing the actual call.

I want to take a folder or panel and reset the custom attributes of all objects. I am not talking about the position type of attributes. I want to reset all custom font, icon, box, etc properties so that they become unchecked in the gui and will then take on whatever gets set in the Items (customize, more) menus.

]]>
« (Previous Post)
(Next Post) »

One Commentto Looking for confirmation that what I want can be done and maybe a snippet showing the actual call.

  1. Anonymous says:

    < ![CDATA[

    It could be possible to copy attributes from a the container to the item through script, but it would require to enumerate all properties, for instance this way (not tested, just dumped here from my head):



    var ed = some_item.getProperties().edit();


    var props = some_item.getParent().getProperties();



    var boolean_attrs = [ “i.rotate”, “i.enabled”, “i.filterTransformed”, “i.onGrid” ];


    var n = boolean_attrs.length;


    for(var i=0; i


      var attr = boolean_attrs[i];


      ed.setInteger(attr, props.getInteger(attr));


    }



    // do this for strings, integers and floats too



    ed.commit();



    This is a bit cumbersome. Another way would be to just create new items with same position intent, label and icon and delete older ones. That’s tidy too.

    ]]>

Leave a Reply

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