3 Replies Latest reply on Mar 29, 2016 7:02 AM by Muhammad.eloc

    TextWrap modify offset

    Foxy Ford Level 1

      I hate to set up the box TextWrap and change the offset control.

       

      I need the script to make it to me.

       

      Select my object, apply the script and auto modify the text wrap offset increasing 1x,

      So other script to decrease 1x.

       

      Thanks!!!

        • 1. Re: TextWrap modify offset
          [Jongware] Most Valuable Participant

          Here's one that works with regular bounding box text wrap. It will only increase the text wrap when the value already is not 0, so it ignores sides where you set it to 0 (of course that check can be removed as well).

          You can change the 'increment' value if you are using inches or another large measurement unit, or you want larger steps, and set it to a negative value to modify it to a 'decrease' script.

           

          //DESCRIPTION:Magic Text Wrap Changer
          // A Jongware Script 27-Aug-2010
          if (app.selection.length == 1 && app.selection[0].hasOwnProperty("textWrapPreferences"))
          {
               increment = 1;
               switch (app.selection[0].textWrapPreferences.textWrapMode)
               {
                    case TextWrapModes.CONTOUR: b = app.selection[0].textWrapPreferences.textWrapOffset + increment; break;
                    default:
                         b = app.selection[0].textWrapPreferences.textWrapOffset;
                         for (a in b)
                              if (b[a] != 0)
                                   b[a] += increment;
               }
               app.selection[0].textWrapPreferences.textWrapOffset = b;
          }
          

           

          An alternative variation can be to always increase all sides (so starting with 0,0,0,0 all around will increase it to 1,1,1,1), and it's also possible to assign a default text wrap if there is none on the selected object.

          • 2. Re: TextWrap modify offset
            Foxy Ford Level 1

            Cool!!!

             

             

            Very good!!

             

            Hmm, with "Wrap around object shape" but I thank you.

             

             

            • 3. Re: TextWrap modify offset
              Muhammad.eloc Level 1

              Dear Jongware,

               

              thanks for your script, but is it possible to modify on it to reverse right and left offset for text wrap

               

               

              Thanks in advance