Layer Item Order - Adobe Community - 9545456

PHOTO EMBED

Fri Mar 01 2024 10:25:42 GMT+0000 (Coordinated Universal Time)

Saved by @snarklife

const cleanSort = function(x,y)

{

    x = x.toLowerCase();

    y = y.toLowerCase();

    return x < y ? -1 : +(x!=y);

};

const sortInLayer = function(/*str*/name,  o,a,s)

{

    o = app.properties.activeDocument;

    if( !o ){ alert( "No document." ); return; }

    o = o.layers.itemByName(String(name));

    if( !o || !o.isValid ){ alert("No layer with that name."); return; }

    for

    (

        (a=(o=o.pageItems).everyItem().na
content_copyCOPY

https://community.adobe.com/t5/indesign-discussions/layer-item-order/m-p/9545456