-
Problem with changing a layers position in a script
So I have a script that needs to change the position of a layer but I keep getting this error: invalid numeric result(divide by zero?)
here is the line:
myComp.layer(2).transform.position + [5,2]Any ideas as to why I would get this?
Here is my While loop, also, the layer is a precomp if that makes a difference(I didnt think it would though)
var myComp;
//Read lins of text. Create a new comp and text layer for each line
var text;while(!myFile.eof)
{
text = myFile.readln();
if(text == "") text = "r";myComp = app.project.items.addComp(text,compW,compH,1,compL,compRate);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Set the text layer
var tl = myComp.layers.addText(text);
var tltxt = tl.property("ADBE Text Properties").property("ADBE Text Document");
var txt = tltxt.value;
txt.font = "Verdana";
tltxt.setValue(txt);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var precomp = myComp.layers;precomp.precompose([1],text + "precomp");
myComp.layer(1).duplicate();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Add Fill Effect
layerProperties = myComp.layer(2);
layerProperties.Effects.addProperty("Fill");
layerProperties.Effects.property("Fill").property("Color").setValue([0,0,0]);////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Add the offset
//layerProperties.transform.position + [5,2];
myComp.layer(1).transform.position + [5,2];}