3 Replies Latest reply: Jan 26, 2012 2:24 PM by booyajamo RSS

    [JS][CS4] Remove all hidden page items?

    booyajamo Community Member

      Hello,

       

      I'm trying to remove all hidden page items regardless of how many sublayers they are burried in. Is this possible? I wrote a snippet here that seems to only partly work. It removes all hidden page items unless two hidden items exist right after each other in the stacking order. Why would this be happening? Any suggestions?

       

      for (i=0; i<doc.pageItems.length; i++){
                if (doc.pageItems[i].hidden == true){
                     doc.pageItems[i].remove();
                     }
           }
      

       

      I'm new to scripting so any help is greatly appreciated.

       

      Thanks!

      Lindsay