Scale layer down relative to comp
Posted: July 8th, 2004, 4:18 am
I am working on a script that takes text out of a file and copies it into existing text layers. I'd like to add in a function that scales the text layer down if it is too large for the screen. This is what I have basically.
var proj = app.project;
var myComp = proj.item(1);
var myLayer = myComp.layer(1);
var layerSize = myLayer.width * (myLayer.scale * .01)
while (layerSize >= 300){
var sclIncr = 100;
myLayer.scale.setValue([sclIncr,sclIncr]);
sclIncr = sclIncr - 2
}
The problem I have is myLayer.scale doesn't return a value, it returns an array. How can I get one of the values out of the array?
Thanks.
var proj = app.project;
var myComp = proj.item(1);
var myLayer = myComp.layer(1);
var layerSize = myLayer.width * (myLayer.scale * .01)
while (layerSize >= 300){
var sclIncr = 100;
myLayer.scale.setValue([sclIncr,sclIncr]);
sclIncr = sclIncr - 2
}
The problem I have is myLayer.scale doesn't return a value, it returns an array. How can I get one of the values out of the array?
Thanks.