ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Text box anchor point from baseline

COW Forums : Adobe After Effects

Respond to this post   •   Return to posts index   •   Read entire thread

Walter Soyka
Re: Text box anchor point from baseline
on Nov 21, 2018 at 2:29:15 pm

[Marko Suto] "This "sourceText.value.baselineLocs" under "Scripts and expressions for working with text" section, gave me hope I could use this array to get the Y position of the last line and use it as anchor point. But I don't know how to define array and how to read the "N-1" value from the array."

Nice! You'd do it like this:

// replace with a reference to your text layer
textLayer = app.project.item(1).layer("OUTPUT TEXT");

// get the baselineLocs array, then peel off the last value
baselineLocs ="Text").property("Source Text").value.baselineLocs;
lastBaselineY = baselineLocs[baselineLocs.length-1];

And here are the downsaved versions of the project I did earlier this morning:

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]

Posts IndexRead Thread 

Current Message Thread:

© 2019 All Rights Reserved