Copy link to clipboard
Copied
I have a bunch of comps, and certain comps require different icons. Instead of manually going in and changing each icon for the specific comp, I’d to just drag all the icons into every comp and reference the contents of the comp name.
Theres video’s per section, every section has 3 video’s and each section has its own icon.
For one section of video’s, comp names are: Careful Close Mindset, Careful Close Approach, Careful Close Skill.
I’d like to ask after effects “If this comp name contains these words, do this”. Is there a way to do that?
So the idea/expression I’d like on opacity is as follows;
if (thisComp.name [not sure what to put here] “Careful Close”) {100}
else {0}
Thanks in advance!
Copy link to clipboard
Copied
You can try this.
if(thisComp.name == "//something"){
100;
}else{
0;
}
Copy link to clipboard
Copied
Not sure "==" works, as the comp names aren't EXACTLY "Careful Close", but have a word after "Careful Close". for example, "Careful Close Skill".
I'm basically trying to ask:
if (thisComp.name CONTAINS "Careful Close") {100}
else {0}
Copy link to clipboard
Copied
If that's the case, you can do if(thisComp.name.indexOf("//something") != -1){
//do this;
}else{
// do that;
}
Copy link to clipboard
Copied
if(regEx.match("Careful Close"*) == true)
{do this}
else
{do that}
You can of course go all fancy on the regex or expand this using JvaScript's native string methods to split substrings or whatever to harden the expression and make it more safe, but that's the basic drill.
Mylenium