Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Re: Can an expression acknowledge the Comp's name?

Cow Forums : Adobe After Effects Expressions
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Re: Can an expression acknowledge the Comp's name?
by Darby Edelen on Nov 13, 2008 at 5:46:25 pm

[Bert Brown] "so for example i have a comp name:

PRIMEHD_P2_L2_TSS

and I want the expression to look for the number after that "L" and adjust a slider number (BAR LENGTH SLIDER) to match that digit. in this case "2""


I think this should get you most of the way there:


n = thisComp.name;
a = n.split("_");


a will be an array with the following values:


a[0] = PRIMEHD
a[1] = P2
a[2] = L2
a[3] = TSS


So to get the digit in a[2] you could use:

dig = a[2].charAt(1) * 1; //multiply by one to convert character to an integer

I haven't tested this but I believe it should work.

Darby Edelen


Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:




Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:



Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Please post Expressions Code in the box below:


Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]