Skip to main content
trashcaneron
Inspiring
August 30, 2022
Answered

Parse Comp Name As Source Text?

  • August 30, 2022
  • 1 reply
  • 321 views

I have hundreds of comps that are labled as like:

"GRID-1XA"

"GRID-1XB" 

 

Within the comp, I have source text that is attached to the comp.name. That's easy! But I want to strip out the first part of the string, so instead the label would be "1XA." Is there a way to ignore everything in the comp name until after the "-"?

 

Essentially, I want to remove the prefix of a comp name when using it as my source text. 

 

I have a work around which is to move all of those "GRID" comps to a seperate bin, name the bin "GRID" and then use AE Global Renamer to strip "GRID-". This works, but then I have multiple comps in my project with the same name which can confuse other expressions...

This topic has been closed for replies.
Correct answer Roland Kahlenberg

The Javascript split method does this. 



const targetCompName = comp("GRID-1XA").name;
targetCompName.split("-")[1]

 

1 reply

Roland Kahlenberg
Roland KahlenbergCorrect answer
Legend
August 30, 2022

The Javascript split method does this. 



const targetCompName = comp("GRID-1XA").name;
targetCompName.split("-")[1]

 

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV