Move text with JavaScript
How do I move a Text Frame using JavaScript? The scripting guide says there is a .move() method that takes a relativeObject and an insertionLocation, but I'm not sure what these parameters refer to. Assigning textframe.position to a pair of coordinates is not working the way I expect it to (the text frame ends up somewhere else and I'm not sure why!).
Code below. Any help would be appreciated!
// destination is the name of the document
var layer = destination.layers[0];
var nametext = layer.textFrames.add();
nametext.contents = "Name LastName"
var charStyle = destination.characterStyles.add("NameStyle");
var charAttr = charStyle.characterAttributes;
charAttr.size = 55;
charAttr.capitalization = FontCapsOption.ALLCAPS;
charAttr.textFont = app.textFonts.getByName("CormorantGaramond-Bold");
charStyle.applyTo(nametext.textRange);
nametext.position = [306, 368.9956]; // Does not seem to do anything
