2 Replies Latest reply on Apr 12, 2014 3:44 AM by LeftHead

    Label each item and select

    Unique Level 1

      Hi forum,

       

      I have a document, which has 3 logos (created in indesign and outlined)  .contentType == ContentType.UNASSIGNED.

       

      I want to select 3 outlined logos individually and resize it... I could only able to select the first two and lable it, when the script is in forward loop...

       

       

      bW ();

      function bW () {

      myGroup = app.documents[0].pageItems.everyItem().getElements();

      for (i=0; i<myGroup.length; i++) {

      //myGroupItems = myGroup.pageItems.everyItem();

      if (myGroup[i].fillColor.name == "Paper" &&

      myGroup[i].contentType == ContentType.UNASSIGNED) {

          app.select(myGroup[i])

          burWhite = app.selection;

      //    app.selection = null;

          //app.select(burWhite);

          }

      }}

       

       

      or

       

      can able to select the last two when reverse loop..

       

       

       

      bW ();

      function bW () {

      myGroup = app.documents[0].pageItems.everyItem().getElements();

      if(myGroup.length>0) {

      for(var i=myGroup.length-1;i>=0;i--){                      

       

      //myGroupItems = myGroup.pageItems.everyItem();

      if (myGroup[i].fillColor.name == "Paper" &&

      myGroup[i].contentType == ContentType.UNASSIGNED) {

          app.select(myGroup[i])

       

      burWhite3 = app.selection[0];

      app.select(burWhite3);

          }

      }}}

       

       

      However when resized they all resized in same size, instead of different sizes...

       

      COuld you please help on this...Screen Shot 2014-04-11 at 13.35.40.png

        • 1. Re: Label each item and select
          LeftHead Level 1

          Hi Unique,

           

          Don't exactly understand the goal and the problem.

           

          You have same size logos and want the result to be your image (different sizes) ? Of the opposite (different sizes to same size) ?

          • 2. Re: Label each item and select
            LeftHead Level 1

            If it's same size logos to different size logos, something like this should work:

             

            bW ();

            function bW () {

                var myGroup = app.documents[0].pageItems.everyItem().getElements();

                for (var i=0; i<myGroup.length; i++) {

                    if (myGroup[i].fillColor.name == "Paper" && myGroup[i].contentType == ContentType.UNASSIGNED) {

                        myGroup[i].horizontalScale =  myGroup[i].verticalScale = 100 - (i * 25);

                    }

                }

            }