get comp by name

This commit is contained in:
derchris 2018-12-19 15:50:45 +01:00
parent ebdf747494
commit 7bf2c94ef5

View file

@ -1,5 +1,10 @@
var comp = app.project.item(2);
var comp;
for (var i = 1; i <= app.project.numItems; i ++) {
if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'intro')) {
comp = app.project.item(i);
break;
}
}
var layer_title = comp.layer('intro_title');
var textProp_title = layer_title.property("Source Text");
var textDocument_title = textProp_title.value;