Question
Help with addText()
I'm passing to addText() a TextDocument from an existing text layer with some modifications. The modified text itself is passed, but other properties, like font and fillColor are not passed. Instead, the current font and fill color in the Character panel are set. Am I doing something wrong? Do I have to manually set every property after the fact?
let selectedLayer = app.project.activeItem.selectedLayers[0];
let sourceDocProp = selectedLayer.sourceText;
let sourceTextDoc = sourceDocProp.value;
let newTextDoc = sourceTextDoc;
newTextDoc.text = "Changed text";
newTextDoc.fillColor = [0,0,0];
newTextDoc.font = "Arial";
let newTextLayer: TextLayer = app.project.activeItem.layers.addText(newTextDoc);
