5 Replies Latest reply on May 5, 2014 11:28 PM by hasvi

    Set Tracking value

    hasvi Level 1

      Hi,

       

       

      Need alter for tracking value.

       

       

      My last line character count is less than 10 in the paragraph, I want give -10 tracking value in the particular paragraph

      My last line character count is more than 70 in the paragraph, I want to give +10 tracking value, in the particular paragraph

       

       

      This is my script for tracking pls help

       

       

      var myDoc=app.activeDocument;

      var myTrack=app.selection[0].paragraphs.item (0).tracking=4;

       

       

      pls correct it

       

       

      by hasvi

        • 1. Re: Set Tracking value
          Laubender Adobe Community Professional & MVP

          @Hasvi – you wanted +10 for the first paragraph in a text selection?

          Then why did you assign the value: 4 ? And not 10 ?

           

          app.selection[0].paragraphs[0].tracking = 10;
          

           

          would apply 10 as tracking value…

          It will not restrict the tracking to the specific text selection, but to all characters that form the first paragraph of that selection.

           

          Uwe

          • 2. Re: Set Tracking value
            hasvi Level 1

            Hi,

             

            I need to change whole document paragraph tracking value,

            If my para length as like below I want to increase the track value +10. Because the last line is very long if we increase the track value we can get one line extra.

             

            "Disability sounds pretty bad. It conjures up images of wheelchairs, artificial legs, white canes, and guide dogs.
            Disabled people are often thought of as not being whole, as missing a crucial piece of the the te the te anatomy."

             

            If my para length as like below I want to decrease the track value -10. Because the last line is very long if we increase the track value we can get one line short.

            "Disability sounds pretty bad. It conjures up images of wheelchairs, artificial legs, white canes, and guide dogs.

            Disabled people are often thought of as not being whole, as missing a crucial piece of the the te the te anatomy
            cost."

             

            Its all for pagination purpose. Is this possible by script?

            • 3. Re: Set Tracking value
              Laubender Adobe Community Professional & MVP

              @hasvi – there are several factors here. One really big one is the paragraph composer. And the justification method used.

               

              If the "standard" Adobe Paragraph Composer is used, not one of the single line composers, it will be hard to impossible to control line length of a given text. Threaded text frames is another factor: Threaded text frames with different values for width.

               

              A complex task…

               

              The first question(s) you have to answer is: When exactly should a line be saved, when exactly should a line be added?
              Could there be, is there a common rule? Can you phrase a rule that is consistent in itself? Maybe a percentage of the width of a text frame; perhaps in dependence of typographic properties like character size and leading? More ambitious: dependent of percantage of white space that happens inside a paragraph… etc.pp. …

               

              Uwe

              • 4. Re: Re: Set Tracking value
                BEGINNER_X Level 3

                Hi Hasvi,

                 

                This code may helpful as per your first thread,

                 

                app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

                app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

                 

                var myPara = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements();

                alert(myPara.length);

                 

                for(i=0; i<myPara.length; i++)

                {

                    if(myPara[i].lines[-1].characters.length > 70)

                    {

                        myPara[i].tracking = 10;

                        }

                    if(myPara[i].lines[-1].characters.length < 10)

                    {

                        myPara[i].tracking = -10;

                        }       

                    }

                 

                Thanks

                SIraj

                • 5. Re: Set Tracking value
                  hasvi Level 1

                  Thank u so much for the timing help

                   

                  Sent from Yahoo Mail on Android