Copy link to clipboard
Copied
I tried writing a script to quickly replace placeholders and it worked, but the second time I ran it, AE crashed
Sorry I found the cause of the error in my unpublished code, now it's fixed...
Copy link to clipboard
Copied
You may need to add a check for the layer type. After the first replacement procedure AE may simply try to replace a placeholder with another. Also the last curly brace doesn't seem to belong anywhere, so maybe it's throwing up on that because it expects a function.
Mylenium
Copy link to clipboard
Copied
Sorry, I'm missing some operations.
After I ran it the first time it was successful, I tried ctrl+z to restore it, and when I ran it again, ae crashed
I have tried not to use ctrl+z, after the material is replaced with a placeholder, re-replace the placeholder with a new material, and then run on this material, ae crashes
Please ignore the last "}", this is my wrong operation
Copy link to clipboard
Copied
Sorry I found the cause of the error in my unpublished code, now it's fixed...
Copy link to clipboard
Copied
I'm using the wrong test to determine if the asset is an external asset
if (myComp.selectedLayers[0].source.file.fsName = null) {}
->
if (myComp.selectedLayers[0].source.file.fsName instanceof String) {}