Can an AE script check which effects are are already applied to the selected layer(s) when it runs ?
Googling and looking through the scripting guide I'm so far not finding a straightforward way to do this. (no such AVLayer or Layer attribute?) I have a script that runs on the selected layer(s) and would like to post a dialogue and abort the script in cases where a specific effect is already applied to any of the selected layers...
If it's not possible to do it that way I'm thinking of doing the check based on layer name - since the layers I'm trying to avoid users running the script on are layers that have previously been created (and named) by my script so I have control of what the layers are named (at least till a user changes the name : )
I think you should do a match name check. Something like if (!specificLayer("Effects")("ADBE Drop Shadow"))
specificLayer("Effects").addProperty("ADBE Drop Shadow")
This way you apply drop shadow on the layer only once, no matter how many times you run the script.
You can get the match name by running the gimmePropPath from the redefinery free scripts collection that you can find here http://www.redefinery.com/index.php . Just check the "Match name" in the script GUI and then select your effect to find its match name.