I'm currently working on an After Effects script that can transfer the style and text of a text layer to another text layer in a different comp. The script works perfectly if the parent text layer only has one style, but I need it to handle a situation where the text is half bold and half normal. Is there a way for the script to iterate through each character in the parent text and apply the corresponding style to the child text?
Currently, this is the code snippet I am using, which I found in a tutorial:
var parentText = comp("Precomp - People").layer("Single Title").text.sourceText;
var parentStyle = comp("Precomp - People").layer("Single Title").text.sourceText.style;
parentStyle.setText( parentText );