2 Replies Latest reply on Jan 2, 2015 4:51 AM by hamdifem

    one selection from Multiple selection

    hamdifem Level 1

      I chose the two objects On the top selection I want to change some features other buttom selection no change How do I specify the upper one selected one script

        • 1. Re: one selection from Multiple selection
          Trevorׅ Adobe Community Professional

          This will do it.

          var mySelections = app.selection;
          (!mySelections || mySelections.length != 2) && exit(); // stop script if there are not 2 items selected
          var topItem, bottomItem, topIndex, bottomProps = {};
          topIndex = (mySelections[0].geometricBounds[0] > mySelections[1].geometricBounds[0]) ? 1 : 0;
              topItem = mySelections[topIndex];
              bottomItem = mySelections[+!topIndex];
          bottomProps.properties = {
              fillColor: bottomItem.fillColor,
              strokeColor: bottomItem.strokeColor,
              strokeWeight: bottomItem.strokeWeight,
              // Etc.
          }
          topItem.properties = bottomProps.properties;
          
          
          • 2. Re: one selection from Multiple selection
            hamdifem Level 1

            wonderful thank you very much