Skip to main content
October 8, 2008
Question

[JS] Formating Text Overflow

  • October 8, 2008
  • 2 replies
  • 393 views
Hello everyone,

Scenario: I have a word that needs content change AND kerning. This word is visible but it may be repeated in the Text Overflow portion of the frame. I am using "myWRDs = myTF.parentStory.search(....)" to change all occurences of the word. So by using a loop, I can access each words and "myWRDs[cpt].insertionPoints[1].kerningValue += 10". But the ones hidden in the Text Overflow, give an error.

Goal: How can I do the kerning change w/o resizing the frame?
This topic has been closed for replies.

2 replies

October 9, 2008
Thank you a lot.

I understand what you are doing, but I cannot modify any other formatting but the perticular character's Kerning I am looking for. Also in case the user is exiting the program early, I cannot change the box size without being able to restore it. Also I am dealing with embedded textframes so I would be limited to the parent size as well.
So my goal is to address the space between 2 characters (I believe it would be an inserpoint) in overflow text. Maybe I am approaching it incorrectly.
Known Participant
October 9, 2008
Try something like this:

var myDoc = app.activeDocument;
resizeOversetContent();

function resizeOversetContent() {
var myStories = myDoc.stories;
var myName = myDoc.paragraphStyles.item("Para Style"); //you must have the content using a specific style so you can edit.
for (var j = myStories.length - 1; j >= 0; j--) {
while (myStories.overflows == true) {
if (myStories.appliedParagraphStyle == myName) {
myName.minimumGlyphScaling = myName.minimumGlyphScaling - 1;
myName.desiredGlyphScaling = myName.desiredGlyphScaling - 1;
myName.minimumWordSpacing = myName.minimumWordSpacing - 0.1;
myName.desiredWordSpacing = myName.desiredWordSpacing - 0.1;
myName.minimumLetterSpacing = myName.minimumLetterSpacing - 0.725;
myName.desiredLetterSpacing = myName.desiredLetterSpacing - 0.725;
}}}}

Let me know if this is what you're after.

Brett