Copy link to clipboard
Copied
Hi, I am trying to create a script that will allow creating point text from paragraph text. Everything is ready, but I ran into the fact that the anchor point works differently for them and when I create point text from paragraph text, it rises crooked
I have attached the code and screenshot where you can see the difference.
Having the same values, they are displayed differently.
var project = app.project;
var comp = project.activeItem;
var layer = comp.selectedLayers[0];
var layerName = layer.name;
var textProp = layer.property("Source Text");
var textDocument = textProp.value;
var textString = textDocument.toString();
var textPos = layer.property("ADBE Transform Group").property("ADBE Position").value;
var textAnchor = layer.property("ADBE Transform Group").property("Anchor Point").value;
var textTrans = layer.property("Transform");
var nexTextLayer = comp.layers.addText(textString);
//var ntexAnchor = nexTextLayer.property("ADBE Transform Group").property("ADBE Anchor Point").setValue(textAnchor);
var ntexPos = nexTextLayer.property("ADBE Transform Group").property("ADBE Position").setValue(textPos);
var ntexAP = nexTextLayer.property("ADBE Transform Group").property("Anchor Point").setValue(textAnchor);
Have something to add?