Page 1 of 1

Accessing text properties

Posted: February 3rd, 2016, 3:01 pm
by spoox
I am trying to figure out if it is possible from an expression to access 2 text properties:

1. If a bounding box is enabled, and if so, its size (width/height). I.e NOT .sourceRectAtTime() but the constraining box that wraps and limits the size of the text.

2. The paragraph alignment setting, i.e. left / center / right / justify last left / justify last right / justify all

So far it seems this is not accessible, as I do not get anywhere fiddling around with theTextLayer.Text.sourceText or theTextLayer("Text")("Source Text"). I see there is a .numProperties but there is no .property() function to access anything, so I am assuming that's the parent's property count.

Text layers apparently do not have any .source either, so there's no way of getting there that way...

Re: Accessing text properties

Posted: February 3rd, 2016, 5:27 pm
by Dan Ebberts
I'm afraid you're out of luck. You can poke around a little with source text expressions like this:

prop = text;
prop.numProperties;

or,

prop = text;
prop(3)(1).name

But I don't think you'll find anything helpful. Different story with scripting though...

Dan

Re: Accessing text properties

Posted: February 4th, 2016, 3:11 am
by spoox
Aha, but that was quite helpful actually at least in understanding how to iterate over the properties - it wasn't apparent how the relation to .numProperties and .(1..numProperties) worked.

For what I am doing I should be able to just write a script that will add the expression to the layer anyhow (if that is possible), that can inspect the values at design-time and just insert them into the expression. If not, I will just have to make these configuration options at the top of the expression..

Re: Accessing text properties

Posted: February 8th, 2016, 5:14 am
by spoox
As a side note: interestingly enough I did not actually need access to these properties, as I only needed to take into account the .left and .top aspects of the rect returned by sourceRectAtTime(). :)