Arranging stacking order from top to bottm


i solved original query, , have removed original defective script post. script below takes set of selected objects , rearranges stacking order (vertically) topmost object @ of stack, vertically lowest @ front (and intervening objects).

 

it should replicate action of jet_stacktoptobottom.jsx, apparently no longer available. hope may who, me, gladly have paid find it!

 

david entwistle

 

var thisdoc = activedocument;

 

// selected objects

var selobj = thisdoc.selection;

 

// count selected objects

var selobjcount = selobj.length;

 

// sort selected objects height page origin

var byproperty = function(prop) {

    return function(a,b) {

        if (typeof a[prop] == "number") {

            return (a[prop] - b[prop]);

        } else {

            return ((a[prop] < b[prop]) ? -1 : ((a[prop] > b[prop]) ? 1 : 0));

        }

    };

};

 

var symbolssorted = selobj.sort(byproperty("top"));

 

// each object in turn in ordered selection, bringtofront

for(i = selobjcount; >0; i--){

          var currobj = symbolssorted[i-1];

          currobj.zorder(zordermethod.bringtofront);

}

 

redraw();

awesome, thank you! looking for, sorted trees (symbols) front. have plenty of use perspective illustrations using symbols or repeated objects.



More discussions in Illustrator Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support