Accessing Baseline text in multi-line text

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
mkeyes
Posts: 1
Joined: March 1st, 2018, 12:18 pm

Hi There- 
I'm rather new to scripting for AE, I've done a bit for Photoshop, but this is uncharted territory for me.

I'm in the process of creating a series of expressions that create the effect of typing text.  I've explored the native effect presets, and unfortunately they are not enough to satisfy this particular client request.  I have the type typing fine, but attaching a cursor to the baseline position of each line of type is proving to be more difficult than I anticipated.

I came across textDocument.baselineLocs in the documentation, but I'm having trouble implementing it, and there doesn't seem to be much on the forum or internet about it.  Is this feature accessible in the expressions or is it only available when accessing it as a runtime script?  I'm not able to get it to work at all in an expression, and when running in EStK I'm able to get an alert of 3.402823466e+38F, which is supposed to indicate that there aren't any characters in the text, but there are.  Has anyone had success using this that they would be willing to share?  This is what I have trying to access the baseline.

Code: Select all

var myText = thisComp.layer("Subheadline").text.sourceText;
var myTextLayer = thisComp.layer("Subheadline");
textProp = myTextLayer.text.sourceText;
textDocument = textProp.value;
textDocument.baselineLocs;
 
here's a link describing what it should do.
Thanks!
Post Reply