From 22b2ffa51da8cad9720938331ac87683f434a07d Mon Sep 17 00:00:00 2001 From: derchris Date: Wed, 9 May 2018 11:32:39 +0200 Subject: [PATCH] gpn18 get composition by name --- gpn18/intro_blau.jsx | 8 +++++++- gpn18/intro_rot.jsx | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gpn18/intro_blau.jsx b/gpn18/intro_blau.jsx index 20dff0f..eb0e1be 100644 --- a/gpn18/intro_blau.jsx +++ b/gpn18/intro_blau.jsx @@ -1,4 +1,10 @@ -var comp = app.project.item(3); +var comp; +for (var i = 1; i <= app.project.numItems; i ++) { + if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'text')) { + comp = app.project.item(i); + break; + } +} var layer_title = comp.layer('intro_title'); var textProp_title = layer_title.property("Source Text"); diff --git a/gpn18/intro_rot.jsx b/gpn18/intro_rot.jsx index e740d19..eb0e1be 100644 --- a/gpn18/intro_rot.jsx +++ b/gpn18/intro_rot.jsx @@ -1,4 +1,10 @@ -var comp = app.project.item(4); +var comp; +for (var i = 1; i <= app.project.numItems; i ++) { + if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === 'text')) { + comp = app.project.item(i); + break; + } +} var layer_title = comp.layer('intro_title'); var textProp_title = layer_title.property("Source Text");