So I found the split function to split a string in words and make an arry, that way I can just search for a match and in return I get the curLayer. I’ve use an if(curProp.expressionEnable == true){ exprAry.push(curProp)} so the loop only gets the expressions that are enabled. But for some reason it also gets some of the expressions box that are disabled… when I search for “color” it also gets me all the layers that have a fill color or a color picker…
This is my script:
var proj = app.project;
app.beginUndoGroup("undo");
var exprAry = new Array();
for(i=1;i<=proj.numItems;i++){
var curItem = proj.item(i);
if(curItem instanceof CompItem){
for(q=1;q<=curItem.numLayers;q++){
var curLayer = curItem.layer(q);
for(w=1;w<=curLayer.numProperties;w++){
var curProp1 = curLayer.property(w);
for(e=1;e<=curProp1.numProperties;e++){
var curProp2 = curProp1.property(e);
if(curProp2.expressionEnabled == true){
exprAry.push(getWords (curProp2));
}
for(a=1;a<=curProp2.numProperties;a++){
var curProp3 = curProp2.property(a);
if(curProp3.expressionEnabled == true){
exprAry.push(getWords (curProp3));
}
for(s=1;s<=curProp3.numProperties;s++){
var curProp4 = curProp3.property(s);
if(curProp4.expressionEnabled == true){
exprAry.push(getWords (curProp4));
}
}
}
}
}
for(m=0;m