Copy link to clipboard
Copied
Hi,
there's a way to Fill all anchored text Frame Proportionally to content (> 1000 anchored frames)?
Thanks for help
Copy link to clipboard
Copied
I'm not sure to understand what you mean by "Fill proportionally to content", but you can fit (anchored text) frames to content:
var isAnchoredTextFrame = function(o)
{
if (o.constructor != TextFrame) return false;
return (o.parent.constructor == Character);
}
var pItems = app.activeDocument.allPageItems;
while (p=pItems.pop())
if (isAnchoredTextFrame(p))
p.fit(FitOptions.frameToContent);
There may be a better way to implement isAnchoredTextFrame(). Our fellow scripters will tell us...
@+
Marc
- - -
http://www.indiscripts.com
Copy link to clipboard
Copied
The OP might mean
p.fit (FitOptions.FILL_PROPORTIONALLY);
I see nothing wrong with your way of collecting anchored frames 🙂
Copy link to clipboard
Copied
[Jongware] wrote:
The OP might mean
p.fit (FitOptions.FILL_PROPORTIONALLY);
In a text frame ??
Copy link to clipboard
Copied
Huh. I should've read more than just the title 😛 (After reading the entire post -- guess you're right...)
Copy link to clipboard
Copied
There may be a better way to implement isAnchoredTextFrame(). Our
fellow scripters will tell us...
I think the most direct (and quickest) way is:
app.documents[0].stories.everyItem().textFrames.everyItem();
Harbs
Copy link to clipboard
Copied
Harbs, you're the best 😉
@+
Marc
Copy link to clipboard
Copied
Aw Shucks!
But don't forget that before CS3, the textFrames of a story were what is now the textContainers...
I think that for it to work in CS2, you had to do:
doc.stories.everyItem().texts.everyItem().textFrames.everyItem();
But my memory might be faulty on the exact working code...