• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using a layer name in text expression

New Here ,
Sep 04, 2024 Sep 04, 2024

Copy link to clipboard

Copied

I have an audio clip as a layer in my project. Let's say its named "20240904-2210.xxx".

I am trying to build a text expression that will take the 2024 and the 09 and the 04, and rewrite it to be: 2024-09-04.

In JavaScript, I can just built a variable & then break it up with substr.

But AE is saying substr is not valid.

How can I break up the audio layer name into separate strings, such as strYear, strMonth, strDay?

At the end, I can just do something like:  result = strYear + "-" + strMonth + "-" + strDay

I know this must be super simple, but for some reason, I cannot figure it out.   ðŸ˜•

TOPICS
Expressions

Views

75

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 05, 2024 Sep 05, 2024

Copy link to clipboard

Copied

LATEST

I'm not sure, but maybe you're talking about something like this?

str = thisComp.layer("20240904-2210.xxx").name;
newStr = str.substr(0,4) + "-" + str.substr(4,2) + "-" + str.substr(6,2);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines