When running this, I always end up with an undefined after it's finished looping. Here's a video of me trying this https://streamable.com/bcg48
Few things I have tried:
- Using a try/catch to bypass it
- Using an if statement to check wether numProperties > 0 before running the loop
- Running it from Extendscript IDE
- Running it from a saved .jsx file
- Running it on a different machine
- Running it on a different version of AE
Wondering what I'm missing, I'm assuming it's something about numProperties that I don't know. Any help is greatly appreciated!
Why do you use the last alert? That is what give undefined. You have an alert inside the function that works ok. Then, when you try to allert the result of the function, it is undefined. To change that either remove the last alert, or return something with the function.