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