ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

TextDocument.fontStyle does not work - any thoughts?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ryan McAdam
TextDocument.fontStyle does not work - any thoughts?
on Aug 15, 2018 at 6:12:00 pm

Hey all,

I know this is a scripting question and not an expression question but I didn't see a scripting form.

Windows 10
After Effects 2018 v15.1.2
Font using: Gotham

I'm creating a UI tool that lets me change font and style of a text layer/s with the click of a button. I can access the TextDocument easy enough and it's font property, but the fontStyle property doesn't seem to work. I've checked scripting documentation and all over the web. Can't find a solution.

Code:
TextDocument.font = "Gotham"; //This works
TextDocument.fontStyle = "bold"; //This does not


Note: If I hyphenate the font name and style ("Gotham-Bold") and push that into the font property of the text document it will work! But, only for that particular pairing and nothing else.

Any suggestions you guys have would be awesome. Thank you so much.

Ryan


Return to posts index

Dan Ebberts
Re: TextDocument.fontStyle does not work - any thoughts?
on Aug 15, 2018 at 6:15:04 pm

I think fontStyle is read-only.

Dan



Return to posts index

Ryan McAdam
Re: TextDocument.fontStyle does not work - any thoughts?
on Aug 15, 2018 at 6:40:12 pm

Thanks for the response, Dan.

Looks like your right.
It is a Read-only attribute.
Any idea on how to change that using Extendscript?


Return to posts index


Dan Ebberts
Re: TextDocument.fontStyle does not work - any thoughts?
on Aug 15, 2018 at 6:42:58 pm

I don't think there's a way.

Dan



Return to posts index

Ryan McAdam
Re: TextDocument.fontStyle does not work - any thoughts? [SOLVED]
on Aug 15, 2018 at 6:53:03 pm

I got a suggestion from David Torno. He suggested I set the text font and style manually then read the value via script. The script value returned was different from the UI value I input manually. So all I had to do was set the text font and style manually get the value via script and then use that value in my variable to make the script work.

Thanks again for the help, Dan.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]