This content has been marked as final. Show 6 replies
I'd tackle this by using the all page items property of the document and then check all the text frames in that array.
You know, the easiest way of getting at text frames is through stories. I would think that you could create a filter clause that could return just the empty frames. I expect Shane could write one that would get them all in one operation, but I'm not as good at filter clauses, and have to iterate--something like this:
repeat with myCounter from 1 to (count stories)
tell story myCounter
set myEmptyFrames to every item of text containers whose contents is ""
There aren't that many stories in a typical document, so having to iterate is not too bad.
Ah, good point Ole. I'd probably use stories too when searching the whole document. PageItems is the way to go when looking at a page or spread.
You could also use:<br /><br /> set theFrames to every item of all page items whose class is text frame and<br />contents = ""<br /><br />-- <br />Shane Stanley <email@example.com>
Thanks for the ideas!
Olav, I never would think to use stories. Our layout is for many small advertisements, many many small text frames. So one full page of our documents could have 40 separate text frames. But I will remember stories for next time.
Shane- thanks for that. I can't believe I did not think to try that (doh!) but that's awesome and soooo much faster than my repeating counter/comparison routine!
Shane's solution is quite cool. But *do* think of stories if you need to deal with text. In general: a.) there are fewer stories than there are page items, b.) there are usually fewer stories than there are text frames. It's often the quickest way to go--just as it's easier to examine links to get at graphics (rather than scanning all page items for those that contain imported graphics).