5 Replies Latest reply on Apr 14, 2017 3:24 AM by Laubender

    How can i change rectangle contour

    robertm43450875 Level 1

      Hi

       

      How can I change rectangle or other object contorus using javascript?

       

      And another question:

      How can i read frame paramethers( for example thickness)

       

       

      Thanks

        • 1. Re: How can i change rectangle contour
          tpk1982 Level 4

          HTH

           

          Screen Shot 2017-03-30 at 11.45.28 AM.png

          1 person found this helpful
          • 2. Re: How can i change rectangle contour
            Oriup Level 1

            Robert,

             

            I think your requirement is, you wanted to search any object stroke weight and change with new stroke weight.

             

            var doc = app.documents[0];
            var myOldStrokeWeight = 1;// find stroke weight
            var myNewStrokeWeight = 5;// change stroke weight
            
            
            changeStrokeWeight ();
            
            
            function changeStrokeWeight(){
              var page = doc.pages;
              for(i=0; i<page.length; i++){
              var myPage = page[i];
              for(j=0; j<myPage.pageItems.length; j++){
              var myObj = myPage.pageItems[j];
              if(myObj.strokeWeight == myOldStrokeWeight){
              myObj.strokeWeight = myNewStrokeWeight;
              }
              }
              }
            }
            

             

             

            Sumit

            1 person found this helpful
            • 3. Re: How can i change rectangle contour
              Laubender Adobe Community Professional & MVP

              Hi Sumit,

              don't think so. See this thread, that could be related:

              Save frame as jpg whthout contour

               

              Where Robert wants to set the strokeWeight to 0 and later back to the initial value after exporting frames to JPEG.

              That would be "dangerous" as I discussed there.

              The values for:

               

              StrokeAlignment
              StrokeColor
              StrokeDashAndGap
              StrokeType

              etc.pp.

               

              could be set back to default that i.a. is governed by the activated object style in the Object Styles panel.
              So you could either strore the values of the properties mentioned above or do the export on a duplicate you can later throw away.

               

              Regards,
              Uwe

              1 person found this helpful
              • 4. Re: How can i change rectangle contour
                Oriup Level 1

                Hi Laubender,

                 

                I got it.

                Robert can apply remove any strokeColor, strokeWeight and export as jpeg and close file without save.

                 

                 

                Sumit

                • 5. Re: How can i change rectangle contour
                  Laubender Adobe Community Professional & MVP

                  Hi Sumit,

                   

                  saving the document before doing anything, exporting to JPEG after setting the stroke weight to 0, closing without saving and reopening the document is also a valid option. I'd prefer to export from duplicated items where the stroke weight is set to 0 and throw away the duplicates.

                   

                  Regards,
                  Uwe