We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
I have used this code to find the textframe count but it shows an script error. Please guide me
var myDoc = app.activeDocument;
var myText= 0;
for (var i = 0; myDoc.stories.length > i; i++)
myText += myDoc.textFrames[i].texts.length
alert("Document contains " + myText + " textframe.");
This code to me seems to be incoherent. Why do you iterate stories and then check the text length and conclude that it would be the frame count. Try to find answers to the following question
This will count all text frames, including the ones placed in any master page.
You tell correct. but it come anchore or inline text frame then it not countable.
if you want to count or access all text frames in the document you have to loop all textContainers arrays of all stories in the document and filter out the text paths that are also text containers.
( ACP )