From 7bf2c94ef52716c883166df16c374cf15306d736 Mon Sep 17 00:00:00 2001 From: derchris Date: Wed, 19 Dec 2018 15:50:45 +0100 Subject: [PATCH] get comp by name --- voc_ae/intro.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/voc_ae/intro.jsx b/voc_ae/intro.jsx index a47b61e..59df0ca 100644 --- a/voc_ae/intro.jsx +++ b/voc_ae/intro.jsx @@ -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;