In my job I have to update text in old projects that has been made by others, and it's always a time-drain to navigate through projects that sometimes look like a bombed brothel

- Cptzap
Moderator: byronnash
I guess you would have to spend considerable effort on it and start by separating the streams for this info in AE itself first. My knowledge is superficial at best, but handling fonts via scripts seems also complicated and limited in other Adobe apps, so it's surely a more generaic problem, probably due to the many options that need to be covered.strawdog wrote:Does anyone have any idea why this information is so hard to get or when it might likely become available? Seems at odds with how accessible everything else is.
Code: Select all
{
// 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...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 all
{ // 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); }
Code: Select all
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);