Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Align Text Left Scripting

New Here ,
Mar 18, 2011 Mar 18, 2011
I’m new to scripting with After Effects and I’m having troubles doing the simplest thing. I got most of my program to work just fine, however, when I used the built-in text replace function it changes my text from left aligned to center aligned. I need to set my text layer to left align again after the text it changed.


Can anyone please help me? I know this is very basic, I just can’t find anything in the scripting guide that will help.

My last resort option is to set the anchor point of the text field but I would rather just set the alignment.


Here is the replace function:


replaceTextInLayer(app.project.item(99).layer(8), "Original", "New")


I just want to left align this text layer.


app.project.item(99).layer(8)


Thanks in advance for your help!

TOPICS
Scripting
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 18, 2011 Mar 18, 2011

Replacing text shouldn't affect the paragraph justification. I've never heard of the replaceTextInLayer() function. Is it possible that you inherited a script from someone and that function is defined somewhere in the code (or maybe in an include file)? In any case, control of justification came in with CS4 and you can see the details here:

http://blogs.adobe.com/toddkopriva/2008/12/after-effects-cs4-scripting-ch.html

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 18, 2011 Mar 18, 2011
LATEST

Dan, thank you for your quick response! That worked for me. I'm not sure why it changes - maybe something with the animation or anchor point. Anyway, the link you sent gave me the code I was looking for. Thanks!

Matt

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines