Page 1 of 1

How do I know Text's width ?

Posted: October 1st, 2012, 8:25 pm
by wing586
How do I know Text's width in Script Code ?

app.project.activeItem.layer(1).property("ADBE Text Properties").width ???

app.project.activeItem.layer(1).property("ADBE Text Properties").property("ADBE Text Document").width ????

I really want to know...

Re: How do I know Text's width ?

Posted: October 3rd, 2012, 1:54 am
by Paul Tuersley
Check out the sourceRectAtTime method in the scripting guide.

Code: Select all

var bounds = app.project.activeItem.layer(1).sourceRectAtTime(activeItem.time, true);
alert("top = " + bounds.top + "\rleft = " + bounds.left + "\rheight = " + bounds.height + "\rwidth = " + bounds.width);

Re: How do I know Text's width ?

Posted: October 6th, 2012, 7:56 am
by wing586
Paul Tuersley wrote:Check out the sourceRectAtTime method in the scripting guide.

Code: Select all

var bounds = app.project.activeItem.layer(1).sourceRectAtTime(activeItem.time, true);
alert("top = " + bounds.top + "\rleft = " + bounds.left + "\rheight = " + bounds.height + "\rwidth = " + bounds.width);
Oh, Thank you for your kindness.