Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Changing tabs value in paragraph style based on longest word

$
0
0

Thanks for your help, Dave. I am new to indesign scripting. I wasn't aware of the horizontalOffset property of text. That was a great tip. Appreciate it.

 

Here's what i ended up doing.

 

  1. Did a GREP search from beginning of paragraph till the colon.
  2. used a for loop to push the horizontalOffset number of  each GREP search into an array.
  3. Used a for loop with if statement on the array to get the highest number in the array. That would be my "Longest Dialogue".
  4. Used geometricBounds() to find the text frame position.
  5. Found the position for the tab stop. tabStopPosition =  longest dialogue position - text frame position.
  6. Added a little buffer to the tabStopPosition so that there would be seperation between the colon and the following text.
  7. Assigned tabStopPosition to a tabStop in the paragraph style associated with the text frame.

 

 

Thanks again for your help.


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>