-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEF_DeactivateEffectsOnComps.jsx
42 lines (35 loc) · 1.64 KB
/
EF_DeactivateEffectsOnComps.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**========================================================================
* ? EF_DeactivateEffectsOnComps.jsx
* @author Eveline Falcão <https://evelinefalcao.com>
* @email [email protected]
* @version 1.0.0
* @createdFor Adobe After Effects CC 2024 (Version 24.1.0 Build 78)
* @description Deactivate a given effect from the selected comps. Is case insensitive.
*========================================================================**/
(function deactivateEffectsOnComps(){
var comps = app.project.selection;
var userInput = prompt("Type the Effect Name you wish to disable:", "Effect Name");
if (userInput) {
var targetEffectName = userInput.toString().toLowerCase();
}
app.beginUndoGroup("'Deactivate Effects'");
for (var item = 0; item < comps.length; item++) {
var curItem = comps[item];
if (curItem instanceof CompItem) {
var layers = curItem.layers;
for (var layer = 1; layer <= layers.length; layer++) {
var currentLayer = layers[layer];
var effectsProp = currentLayer.property("ADBE Effect Parade");
if (effectsProp) {
for(var effect = 1; effect <= effectsProp.numProperties; effect++){
var effectName = effectsProp.property(effect).name.toLowerCase();
if (effectName == targetEffectName) {
effectsProp.property(effect).enabled = false;
}
}
}
}
}
}
app.endUndoGroup();
})();