Execute code when layer has a specific name
- October 25, 2021
- 1 reply
- 294 views
Hi,
I'm Bram from the Netherlands. I'm building a script to efficiently build movie credits.
I have a problem with creating various different scenarios for the sub-headings.
When the first layer created in the comp is a sub-heading it will get a scroll animation.
When a cutscene is above the to be create sub-heading it gets a certain amount of spacing and when there's a heading above it it gets a different amount of spacing.
The rest will get the same amount of spacing so I just to put that in the else{} section of the button.
But I don't get the button to function as I want it to. I tried to solve it with:
app.project.item(...).numLayers.name.subStr(..., ...) == "...";
app.project.item(...).numLayers.name == "...";
but none of the two work and I'm starting to loose my hope.
I've added a screenshot of what I got so far.
Does anybody have great suggestions on how to fix this?
Thanks in advance for your suggestions.
