Paul Tuersley wrote:
After Effects CS4 added more scripting support for text properties, but I don't think the documentation is available yet. Here's an example of how you'd query and change the font and font size:
Code:
{
// select a text layer before running this script
var activeItem = app.project.activeItem;
var theValue = activeItem.selectedLayers[0].sourceText.value;
alert("font = " + activeItem.selectedLayers[0].sourceText.value.font);
alert("fontsize = " + activeItem.selectedLayers[0].sourceText.value.fontSize);
theValue.font = "ArialMT";
theValue.fontSize = 24;
activeItem.selectedLayers[0].sourceText.setValue(theValue);
alert("font = " + activeItem.selectedLayers[0].sourceText.value.font);
alert("fontSize = " + activeItem.selectedLayers[0].sourceText.value.fontSize);
}
I'm wondering if I can use the script above that Paul wrote to manipulate multiple styles within the same text field...
For example: First name in HelveticaBld and last name in HelveticaLt on the same line. They would be in the same line so I couldn't set theValue as the selectedLayer because there would be two values for the same line... Am I making sense?

Would something like this work? I'm using CS5.
Code:
var name = comp.layer(i).sourceText;
firstNameValue.font = "Helvetica Neue LT Std";
firstNameValue.fontstyle = "73 Bold Extended";
firstNameValue.fontsize = 24;
lastNameValue.font = "Helvetica Neue LT Std";
lastNameValue.fontstyle = "55 Roman";
lastNameValue.fontSize = 24;
name.setValue(firstNameValue.toUpperCase() + " " + lastNameValue);
I realized that this still doesn't account for the actual text itself... firstName = shawn, lastName = baden...