Copy link to clipboard
Copied
Hi everybody,
I'm working on a script about text overflow in InDesign.
My purpose is to find how many characters are overflowing textFrame or where text starts to overflow (for each textFrame in document).
So far, I've found that textFrame object has a property called
overflows (boolean)
which indicates if its text overflows. But I could not find more information in this object properties.
Then, I worked on preflight.
I try :
var doc = app.activeDocument;
var my_profile = app.preflightProfiles.firstItem();
var my_process = app.preflightProcesses.add(app.activeDocument, my_profile);
my_process.waitForProcess();
var results = my_process.aggregatedResults;
And I get :
We can see that here, we have the information I want. But it depends on user's interface language in InDesign so I cannot properly use this solution.
My last lead is to find information used in that InDesign screen (editor mode) :
Can somebody help me to achieve my purpose please ?
Thanks in advance
Regards
Hi @emiliep89320758,
With the textframe selected run the following code
var tf = app.selection[0]
var oversetContent = tf.parentStory.insertionPoints.itemByRange(tf.insertionPoints[-1].index, tf.parentStory.insertionPoints[-1].index).contents
alert("Overset Content is \""+ oversetContent + "\" length " + oversetContent[0].length + " starts at index " + tf.insertionPoints[-1].index)
-Manan
Copy link to clipboard
Copied
Hi @emiliep89320758,
With the textframe selected run the following code
var tf = app.selection[0]
var oversetContent = tf.parentStory.insertionPoints.itemByRange(tf.insertionPoints[-1].index, tf.parentStory.insertionPoints[-1].index).contents
alert("Overset Content is \""+ oversetContent + "\" length " + oversetContent[0].length + " starts at index " + tf.insertionPoints[-1].index)
-Manan