Question

I am creating a Javascript script to use with Indesign Server (CS3).

Trying to find all textareas within a document and find the contents of them.

I can easily loop through all the textareas, using the functions provided by Adobe.

However, when i try to get the content of the TextArea, I only get the content that is visible within that textarea, not the out port text.

document.TextAreas[0].contents

In other words, if the Indesign document contains a textarea with a little plus sign, indicating that there is more text, but it did not fit, then my script does not return the hidden text.

Or, to put it another words again. Can i get the entire content when the 'overflows' property of the 'textarea' is false;

Full code:

function FindAllTextBoxes(){
        var alertMessage;
        for (var myCounter = myDoc.textFrames.length-1; myCounter >= 0; myCounter--) {
        var myTextFrame = myDoc.textFrames[myCounter];
            alertMessage += "\nTextbox  content: " + myTextFrame.contents;
            alertMessage += "\nOverflow:" + myTextFrame.overflows;
            alert(alertMessage);
        }
}

How can I read the full content of the Textarea?

Was it helpful?

Solution

A little late, but just came across this. This is tested with InDesign CS5 - the following line will get all of the overflown text from a TextFrame:

var content = myTextFrame.parentStory.contents;

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top